diff --git a/README.md b/README.md index 7ef843011..6ae7f9b3f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A small, portable and extensible 3D coding framework written in C++: - simple [Orthodox C++](https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b) coding style and APIs - extensible through external code modules living in git repositories -- runs on OSX, Linux (incl RaspberryPi), Windows, iOS, Android, emscripten, PNaCl from the same C++ source +- runs on OSX, Linux (incl RaspberryPi), Windows, iOS, Android, emscripten, from the same C++ source - renders through GL, GLES2, WebGL, Metal, D3D11 from same shader source - produces small executables (e.g. emscripten WebGL demos starting at around 100 Kbytes) - async data loading from web or disc diff --git a/code/Modules/Core/App.cc b/code/Modules/Core/App.cc index 70eeb1f97..6e9656772 100644 --- a/code/Modules/Core/App.cc +++ b/code/Modules/Core/App.cc @@ -9,8 +9,6 @@ #include "Core/Trace.h" #if ORYOL_EMSCRIPTEN #include -#elif ORYOL_PNACL -#include "Core/pnacl/pnaclInstance.h" #elif ORYOL_IOS #include "Core/ios/iosBridge.h" #elif ORYOL_MACOS && ORYOL_METAL @@ -82,8 +80,6 @@ App::StartMainLoop() { // empty } this->androidBridge->onStop(); - #elif ORYOL_PNACL - pnaclInstance::Instance()->startMainLoop(this); #elif ORYOL_UWP // do nothing here #else @@ -92,9 +88,7 @@ App::StartMainLoop() { } #endif - // NOTE: PNaCl and UWP are the only platform where StartMainLoop - // returns while the app continues running! - #if !(ORYOL_PNACL || ORYOL_UWP) + #if !ORYOL_UWP Log::Info("<= App::StartMainLoop()\n"); Core::Discard(); #endif diff --git a/code/Modules/Core/CMakeLists.txt b/code/Modules/Core/CMakeLists.txt index fa5bd16c7..6f13ce3a6 100644 --- a/code/Modules/Core/CMakeLists.txt +++ b/code/Modules/Core/CMakeLists.txt @@ -102,13 +102,6 @@ fips_begin_module(Core) fips_files(osxBridge.h osxBridge.mm osxInputDefs.h) fips_frameworks_osx(Cocoa Metal MetalKit QuartzCore) endif() - if (FIPS_PNACL) - fips_dir(pnacl) - fips_files( - pnaclInstance.cc pnaclInstance.h - pnaclModule.cc pnaclModule.h - ) - endif() fips_dir(.) fips_files(Trace.h Trace.cc) if (FIPS_PROFILING AND (FIPS_LINUX OR FIPS_MACOS OR FIPS_WINDOWS)) diff --git a/code/Modules/Core/Log.cc b/code/Modules/Core/Log.cc index df4f42c0d..bb1135c25 100644 --- a/code/Modules/Core/Log.cc +++ b/code/Modules/Core/Log.cc @@ -15,11 +15,8 @@ #if ORYOL_ANDROID #include #endif -#if ORYOL_PNACL -#include "Core/pnacl/pnaclInstance.h" -#endif -#if ORYOL_WINDOWS || ORYOL_PNACL +#if ORYOL_WINDOWS const int LogBufSize = 4 * 1024; #endif @@ -158,7 +155,7 @@ Log::vprint(Level lvl, const char* msg, va_list args) { } __android_log_vprint(pri, "oryol", msg, args); #else - #if ORYOL_WINDOWS || ORYOL_PNACL + #if ORYOL_WINDOWS va_list argsCopy; va_copy(argsCopy, args); #endif @@ -167,25 +164,12 @@ Log::vprint(Level lvl, const char* msg, va_list args) { // va_list, so we made a copy before if necessary std::vprintf(msg, args); - #if ORYOL_WINDOWS || ORYOL_PNACL + #if ORYOL_WINDOWS char buf[LogBufSize]; std::vsnprintf(buf, sizeof(buf), msg, argsCopy); #if ORYOL_WINDOWS buf[LogBufSize - 1] = 0; OutputDebugStringA(buf); - #elif ORYOL_PNACL - // replace non-jsonable characters - char* p = buf; - do { - if (*p == '"') *p = '\''; - else if (*p == '\n') *p = ' '; - } - while (*p++); - char json[LogBufSize + 64]; - std::snprintf(json, sizeof(json), "{\"msg\":\"log\",\"val\":\"%s\"}", buf); - if (pnaclInstance::HasInstance()) { - pnaclInstance::Instance()->putMsg(json); - } #endif #endif #endif @@ -217,14 +201,6 @@ Log::AssertMsg(const char* cond, const char* msg, const char* file, int line, co cond, msg ? msg : "none", file, line, func, callstack); buf[LogBufSize - 1] = 0; OutputDebugStringA(buf); - #elif ORYOL_PNACL - if (pnaclInstance::HasInstance()) { - char buf[LogBufSize]; - std::snprintf(buf, sizeof(buf), "{\"msg\":\"log\",\"val\":\"\n\n*** ORYOL ASSERT: %s\n msg=%s\n file=%s\n line=%d\n func=%s callstack:\n%s\n\"}", - cond, msg ? msg : "none", file, line, func, callstack); - buf[LogBufSize - 1] = 0; - pnaclInstance::Instance()->putMsg(buf); - } #endif #endif } diff --git a/code/Modules/Core/Main.h b/code/Modules/Core/Main.h index c81e121da..e7ee34296 100644 --- a/code/Modules/Core/Main.h +++ b/code/Modules/Core/Main.h @@ -20,8 +20,6 @@ #include "Core/uwp/uwpBridge.h" #elif ORYOL_ANDROID #include "Core/android/android_native_app_glue.h" -#elif ORYOL_PNACL -#include "Core/pnacl/pnaclModule.h" #endif #include "Core/App.h" #include "Core/String/WideString.h" @@ -62,19 +60,6 @@ void android_main(struct android_app* app_) { \ app->StartMainLoop(); \ Oryol::Memory::Delete(app); \ } -#elif ORYOL_PNACL -#define OryolMain(clazz) \ -namespace pp \ -{ \ - Module* CreateModule() \ - { \ - return Memory::New(); \ - }; \ -} \ -void PNaclAppCreator() {\ - static clazz* app = Memory::New(); \ - app->StartMainLoop(); \ -} #else #define OryolMain(clazz) \ Oryol::Args OryolArgs; \ diff --git a/code/Modules/Core/StackTrace.cc b/code/Modules/Core/StackTrace.cc index 8b4b187d4..6cef4d696 100644 --- a/code/Modules/Core/StackTrace.cc +++ b/code/Modules/Core/StackTrace.cc @@ -6,7 +6,7 @@ #if !ORYOL_UWP #define HAVE_STACKWALKER (1) #endif -#elif ORYOL_EMSCRIPTEN||ORYOL_ANDROID||ORYOL_PNACL +#elif ORYOL_EMSCRIPTEN||ORYOL_ANDROID #define HAVE_BACKTRACE (0) #define HAVE_STACKWALKER (0) #else diff --git a/code/Modules/Core/pnacl/pnaclInstance.cc b/code/Modules/Core/pnacl/pnaclInstance.cc deleted file mode 100644 index 84a3d7a9a..000000000 --- a/code/Modules/Core/pnacl/pnaclInstance.cc +++ /dev/null @@ -1,203 +0,0 @@ -//------------------------------------------------------------------------------ -// pnaclInstance.cc -//------------------------------------------------------------------------------ -#include "Pre.h" -#include "pnaclInstance.h" -#include "Core/Assertion.h" -#include "Core/App.h" -#include "ppapi/cpp/input_event.h" -#include "ppapi/cpp/var.h" -#include "ppapi/lib/gl/gles2/gl2ext_ppapi.h" - -// externally provided Oryol main function -void PNaclAppCreator(); - -namespace Oryol { -namespace _priv { - -pnaclInstance* pnaclInstance::self = nullptr; - -//------------------------------------------------------------------------------ -pnaclInstance::pnaclInstance(PP_Instance inst) : -pp::Instance(inst), -callbackFactory(this), -width(0), -height(0), -app(nullptr) { - o_assert(nullptr == self); - self = this; -} - -//------------------------------------------------------------------------------ -pnaclInstance::~pnaclInstance() { - o_assert(nullptr != self); - self = nullptr; -} - -//------------------------------------------------------------------------------ -bool -pnaclInstance::HasInstance() { - return (nullptr != pnaclInstance::self); -} - -//------------------------------------------------------------------------------ -pnaclInstance* -pnaclInstance::Instance() { - o_assert(nullptr != pnaclInstance::self); - return pnaclInstance::self; -} - -//------------------------------------------------------------------------------ -bool -pnaclInstance::Init(uint32_t argc, const char* argn[], const char* argv[]) { - if (!glInitializePPAPI(pp::Module::Get()->get_browser_interface())) { - Log::Error("Unable to initialize GL PPAPI!\n"); - return false; - } - PNaclAppCreator(); - return true; -} - -//------------------------------------------------------------------------------ -void -pnaclInstance::DidChangeView(const pp::View& view) { - this->width = view.GetRect().width(); - this->height = view.GetRect().height(); - if (!this->context.is_null()) { - this->context.ResizeBuffers(this->width, this->height); - } - if (this->viewEventFunc) { - this->viewEventFunc(view); - } -} - -//------------------------------------------------------------------------------ -void -pnaclInstance::DidChangeFocus(bool hasFocus) { - pp::Instance::DidChangeFocus(hasFocus); -} - -//------------------------------------------------------------------------------ -bool -pnaclInstance::HandleInputEvent(const pp::InputEvent& event) { - if (this->inputEventFunc) { - return this->inputEventFunc(event); - } - else { - return pp::Instance::HandleInputEvent(event); - } -} - -//------------------------------------------------------------------------------ -bool -pnaclInstance::HandleDocumentLoad(const pp::URLLoader& urlLoader) { - // FIXME! - return pp::Instance::HandleDocumentLoad(urlLoader); -} - -//------------------------------------------------------------------------------ -void -pnaclInstance::HandleMessage(const pp::Var& message) { - // FIXME! - pp::Instance::HandleMessage(message); -} - -//------------------------------------------------------------------------------ -bool -pnaclInstance::initGL(const int32_t* attribList) { - this->context = pp::Graphics3D(this, attribList); - if (!this->BindGraphics(this->context)) { - Log::Error("Unable to bind 3D context!\n"); - this->context = pp::Graphics3D(); - glSetCurrentContextPPAPI(0); - return false; - } - glSetCurrentContextPPAPI(this->context.pp_resource()); - return true; -} - -//------------------------------------------------------------------------------ -void -pnaclInstance::startMainLoop(App* app_) { - o_assert(nullptr == this->app); - o_assert(nullptr != app_); - this->app = app_; - this->doOneFrame(0); -} - -//------------------------------------------------------------------------------ -void -pnaclInstance::doOneFrame(int32_t) { - o_assert(nullptr != this->app); - o_assert(!this->context.is_null()); - this->app->onFrame(); - this->flushMessages(); - this->context.SwapBuffers(this->callbackFactory.NewCallback(&pnaclInstance::doOneFrame)); -} - -//------------------------------------------------------------------------------ -int -pnaclInstance::GetCanvasWidth() const { - return this->width; -} - -//------------------------------------------------------------------------------ -int -pnaclInstance::GetCanvasHeight() const { - return this->height; -} - -//------------------------------------------------------------------------------ -/** - NOTE: this method can be called from any thread. -*/ -void -pnaclInstance::putMsg(const char* str) { - this->msgLock.LockWrite(); - this->msgQueue.Enqueue(pp::Var(str)); - this->msgLock.UnlockWrite(); -} - -//------------------------------------------------------------------------------ -void -pnaclInstance::flushMessages() { - this->msgLock.LockWrite(); - Queue q(std::move(this->msgQueue)); - this->msgLock.UnlockWrite(); - while (!q.Empty()) { - pp::Var var(q.Dequeue()); - o_assert(var.is_string()); - this->PostMessage(var); - } -} - -//------------------------------------------------------------------------------ -void -pnaclInstance::enableInput(std::function func) { - this->RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE | - PP_INPUTEVENT_CLASS_WHEEL | - PP_INPUTEVENT_CLASS_KEYBOARD); - this->inputEventFunc = func; -} - -//------------------------------------------------------------------------------ -void -pnaclInstance::disableInput() { - this->RequestInputEvents(0); - this->inputEventFunc = nullptr; -} - -//------------------------------------------------------------------------------ -void -pnaclInstance::enableViewEvents(std::function func) { - this->viewEventFunc = func; -} - -//------------------------------------------------------------------------------ -void -pnaclInstance::disableViewEvents() { - this->viewEventFunc = nullptr; -} - -} // namespace _priv -} // namespace Oryol diff --git a/code/Modules/Core/pnacl/pnaclInstance.h b/code/Modules/Core/pnacl/pnaclInstance.h deleted file mode 100644 index b7d9431d8..000000000 --- a/code/Modules/Core/pnacl/pnaclInstance.h +++ /dev/null @@ -1,83 +0,0 @@ -#pragma once -//------------------------------------------------------------------------------ -/** - @class Oryol::_priv::pnaclInstance - @ingroup _priv - @brief derived pp::Instance class for PNaCl port -*/ -#include "Core/Types.h" -#include "Core/Containers/Queue.h" -#include "Core/Threading/RWLock.h" -#include "ppapi/cpp/instance.h" -#include "ppapi/cpp/graphics_3d.h" -#include "ppapi/utility/completion_callback_factory.h" - -namespace Oryol { -class App; -namespace _priv { -class pnaclInstance : public pp::Instance { -public: - /// constructor - pnaclInstance(PP_Instance instance); - /// destructor - virtual ~pnaclInstance(); - /// return true if the pnaclInstance exists - static bool HasInstance(); - /// get a pointer to the (unique) pnaclInstance object - static pnaclInstance* Instance(); - - /// initialization callback - virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]); - /// did change view callback - virtual void DidChangeView(const pp::View& view); - /// did change focus callback - virtual void DidChangeFocus(bool has_focus); - /// handle an input event - virtual bool HandleInputEvent(const pp::InputEvent& event); - /// document-load callback - virtual bool HandleDocumentLoad(const pp::URLLoader& url_loader); - /// post-message callback - virtual void HandleMessage(const pp::Var& message); - - /// get current canvas width - int GetCanvasWidth() const; - /// get current canvas height - int GetCanvasHeight() const; - - /// this will be called by App::StartMainLoop - void startMainLoop(App* app); - /// put a message to the web page - void putMsg(const char* str); - - /// enable input (called by Input module if present) - void enableInput(std::function handlerFunc); - /// disable input (called by Input module) - void disableInput(); - - /// enable view event handling (called by graphics system) - void enableViewEvents(std::function handlerFunc); - /// disable view event handling - void disableViewEvents(); - /// initialize the GL context - bool initGL(const int32_t* attribList); -private: - /// this is the per-frame function, it will schedule itself to implement the frame loop - void doOneFrame(int32_t dummy); - /// flush messages (called from within doOneFrame) - void flushMessages(); - - static pnaclInstance* self; - pp::CompletionCallbackFactory callbackFactory; - pp::Graphics3D context; - int width; - int height; - App* app; - RWLock msgLock; - Queue msgQueue; - static const int MaxQueuedEvents = 64; - std::function inputEventFunc; - std::function viewEventFunc; -}; - -} // namespace _priv -} // namespace Oryol diff --git a/code/Modules/Core/pnacl/pnaclModule.cc b/code/Modules/Core/pnacl/pnaclModule.cc deleted file mode 100644 index 5b79bfa0a..000000000 --- a/code/Modules/Core/pnacl/pnaclModule.cc +++ /dev/null @@ -1,19 +0,0 @@ -//------------------------------------------------------------------------------ -// pnaclModule.cc -//------------------------------------------------------------------------------ -#include "Pre.h" -#include "pnaclModule.h" -#include "Core/pnacl/pnaclInstance.h" -#include "ppapi/gles2/gl2ext_ppapi.h" - -namespace Oryol { -namespace _priv { - -//------------------------------------------------------------------------------ -pp::Instance* -pnaclModule::CreateInstance(PP_Instance instance) { - return new pnaclInstance(instance); -} - -} // namespace _priv -} // namespace Oryol \ No newline at end of file diff --git a/code/Modules/Core/pnacl/pnaclModule.h b/code/Modules/Core/pnacl/pnaclModule.h deleted file mode 100644 index d95db7912..000000000 --- a/code/Modules/Core/pnacl/pnaclModule.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -//------------------------------------------------------------------------------ -/** - @class Oryol::_priv::pnaclModule - @ingroup _priv - @brief derived PP::Module class for PNaCl port -*/ -#include "ppapi/cpp/module.h" - -namespace Oryol { -namespace _priv { - -class pnaclModule : public pp::Module { -public: - /// return a pp::Instance object - virtual pp::Instance* CreateInstance(PP_Instance instance); -}; - -} // namespace _priv -} // namespace Oryol \ No newline at end of file diff --git a/code/Modules/Core/posix/precompiled.h b/code/Modules/Core/posix/precompiled.h index cd2bedbb1..51ee784d0 100644 --- a/code/Modules/Core/posix/precompiled.h +++ b/code/Modules/Core/posix/precompiled.h @@ -15,9 +15,4 @@ #define __STRICT_ANSI__ #endif -// and another workaround for PNaCl which requires __STRICT_ANSI__ -// to be undefined :/ -#if ORYOL_PNACL && defined(__STRICT_ANSI__) -#undef __STRICT_ANSI__ -#endif #include diff --git a/code/Modules/Gfx/CMakeLists.txt b/code/Modules/Gfx/CMakeLists.txt index d9ebe79d2..1806b2531 100644 --- a/code/Modules/Gfx/CMakeLists.txt +++ b/code/Modules/Gfx/CMakeLists.txt @@ -114,10 +114,6 @@ fips_begin_module(Gfx) fips_dir(ios) fips_files(iosDisplayMgr.mm iosDisplayMgr.h) endif() - if (FIPS_PNACL) - fips_dir(pnacl) - fips_files(pnaclDisplayMgr.cc pnaclDisplayMgr.h) - endif() if (ORYOL_OPENGL) if (FIPS_RASPBERRYPI) fips_dir(egl) diff --git a/code/Modules/Gfx/Core/displayMgr.h b/code/Modules/Gfx/Core/displayMgr.h index 6a76adc7e..22f47fd5b 100644 --- a/code/Modules/Gfx/Core/displayMgr.h +++ b/code/Modules/Gfx/Core/displayMgr.h @@ -45,12 +45,6 @@ namespace Oryol { namespace _priv { class displayMgr : public iosDisplayMgr { }; } } -#elif ORYOL_PNACL -#include "Gfx/pnacl/pnaclDisplayMgr.h" -namespace Oryol { -namespace _priv { -class displayMgr : public pnaclDisplayMgr { }; -} } #else #include "Gfx/Core/displayMgrBase.h" namespace Oryol { diff --git a/code/Modules/Gfx/gl/gl_impl.h b/code/Modules/Gfx/gl/gl_impl.h index aa50e6abb..41048aea3 100644 --- a/code/Modules/Gfx/gl/gl_impl.h +++ b/code/Modules/Gfx/gl/gl_impl.h @@ -13,11 +13,6 @@ #elif ORYOL_IOS #include #include -#elif ORYOL_PNACL -#define GL_GLEXT_PROTOTYPES -#include "GLES2/gl2.h" -#include "GLES2/gl2ext.h" -#include #elif ORYOL_EMSCRIPTEN #if ORYOL_OPENGLES2 #define GL_GLEXT_PROTOTYPES diff --git a/code/Modules/Gfx/pnacl/pnaclDisplayMgr.cc b/code/Modules/Gfx/pnacl/pnaclDisplayMgr.cc deleted file mode 100644 index 52116214d..000000000 --- a/code/Modules/Gfx/pnacl/pnaclDisplayMgr.cc +++ /dev/null @@ -1,139 +0,0 @@ -//------------------------------------------------------------------------------ -// pnaclDisplayMgr.cc -//------------------------------------------------------------------------------ -#include "Pre.h" -#include "pnaclDisplayMgr.h" -#include "Gfx/gl/gl_impl.h" -#include "Gfx/gl/glCaps.h" -#include "Core/String/StringBuilder.h" -#include "ppapi/lib/gl/gles2/gl2ext_ppapi.h" - -namespace Oryol { -namespace _priv { - -using namespace _priv; - -//------------------------------------------------------------------------------ -pnaclDisplayMgr::pnaclDisplayMgr() : -glFramebufferWidth(0), -glFramebufferHeight(0) { - // empty -} - -//------------------------------------------------------------------------------ -pnaclDisplayMgr::~pnaclDisplayMgr() { - // empty -} - -//------------------------------------------------------------------------------ -void -pnaclDisplayMgr::SetupDisplay(const GfxSetup& gfxSetup, const gfxPointers& ptrs) { - o_assert(!this->IsDisplayValid()); - - Log::Info("pnaclDisplayMgr::SetupDisplay() called!\n"); - displayMgrBase::SetupDisplay(gfxSetup, ptrs); - - // const int32_t numSampleBuffers = gfxSetup.Samples > 1 ? 1 : 0; - const int32_t attribList[] = { - PP_GRAPHICS3DATTRIB_RED_SIZE, PixelFormat::NumBits(gfxSetup.ColorFormat, PixelChannel::Red), - PP_GRAPHICS3DATTRIB_GREEN_SIZE, PixelFormat::NumBits(gfxSetup.ColorFormat, PixelChannel::Green), - PP_GRAPHICS3DATTRIB_BLUE_SIZE, PixelFormat::NumBits(gfxSetup.ColorFormat, PixelChannel::Blue), - PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 0, - PP_GRAPHICS3DATTRIB_DEPTH_SIZE, PixelFormat::NumBits(gfxSetup.DepthFormat, PixelChannel::Depth), - PP_GRAPHICS3DATTRIB_STENCIL_SIZE, PixelFormat::NumBits(gfxSetup.DepthFormat, PixelChannel::Stencil), - PP_GRAPHICS3DATTRIB_WIDTH, gfxSetup.Width, - PP_GRAPHICS3DATTRIB_HEIGHT, gfxSetup.Height, - /* - MSAA currently broken: https://code.google.com/p/chromium/issues/detail?id=285475 - PP_GRAPHICS3DATTRIB_SAMPLES, gfxSetup.Samples, - PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, numSampleBuffers, - */ - PP_GRAPHICS3DATTRIB_SWAP_BEHAVIOR, PP_GRAPHICS3DATTRIB_BUFFER_DESTROYED, - PP_GRAPHICS3DATTRIB_NONE - }; - pnaclInstance::Instance()->initGL(attribList); - - // check if we need to resize the canvas - const int reqWidth = gfxSetup.Width; - const int reqHeight = gfxSetup.Height; - const int canvasWidth = pnaclInstance::Instance()->GetCanvasWidth(); - const int canvasHeight = pnaclInstance::Instance()->GetCanvasHeight(); - if ((reqWidth != canvasWidth) || (reqHeight != canvasHeight)) { - this->requestCanvasResize(reqWidth, reqHeight); - } - - glCaps::Setup(glCaps::GLES2); - - // NOTE: we put in the requested framebuffer size regardless of the - // actual size, the framebuffer will be resized in the next frame - // on the web page - this->glFramebufferWidth = reqWidth; - this->glFramebufferHeight = reqHeight; - this->displayAttrs.FramebufferWidth = this->glFramebufferWidth; - this->displayAttrs.FramebufferHeight = this->glFramebufferHeight; - this->displayAttrs.WindowWidth = this->glFramebufferWidth; - this->displayAttrs.WindowHeight = this->glFramebufferHeight; - - // register DidChangeView event handler - Log::Info("registering DidChangeView handler\n"); - pnaclInstance::Instance()->enableViewEvents([this] (const pp::View& e) { - return this->handleViewEvent(e); - }); -} - -//------------------------------------------------------------------------------ -void -pnaclDisplayMgr::DiscardDisplay() { - o_assert(this->IsDisplayValid()); - this->glFramebufferWidth = 0; - this->glFramebufferHeight = 0; - glCaps::Discard(); - displayMgrBase::DiscardDisplay(); -} - -//------------------------------------------------------------------------------ -void -pnaclDisplayMgr::Present() { - // swap buffer happens outside of the Oryol frame in pnaclInstance - displayMgrBase::Present(); -} - -//------------------------------------------------------------------------------ -void -pnaclDisplayMgr::glBindDefaultFramebuffer() { - ::glBindFramebuffer(GL_FRAMEBUFFER, 0); - ORYOL_GL_CHECK_ERROR(); -} - -//------------------------------------------------------------------------------ -void -pnaclDisplayMgr::requestCanvasResize(int newWidth, int newHeight) { - StringBuilder strBuilder; - strBuilder.Format(128, "{\"msg\":\"resize\", \"w\":%d, \"h\":%d}", newWidth, newHeight); - pnaclInstance::Instance()->putMsg(strBuilder.AsCStr()); -} - -//------------------------------------------------------------------------------ -bool -pnaclDisplayMgr::handleViewEvent(const pp::View& view) { - - const int newWidth = pnaclInstance::Instance()->GetCanvasWidth(); - const int newHeight = pnaclInstance::Instance()->GetCanvasHeight(); - if ((newWidth != this->glFramebufferWidth) || (newHeight != this->glFramebufferHeight)) { - - this->glFramebufferWidth = newWidth; - this->glFramebufferHeight = newHeight; - - // update display attributes - this->displayAttrs.FramebufferWidth = this->glFramebufferWidth; - this->displayAttrs.FramebufferHeight = this->glFramebufferHeight; - this->displayAttrs.WindowWidth = this->glFramebufferWidth; - this->displayAttrs.WindowHeight = this->glFramebufferHeight; - - Log::Info("framebuffer size changed to w=%d, h=%d\n", newWidth, newHeight); - } - return true; -} - -} // namespace _priv -} // namespace Oryol diff --git a/code/Modules/Gfx/pnacl/pnaclDisplayMgr.h b/code/Modules/Gfx/pnacl/pnaclDisplayMgr.h deleted file mode 100644 index 3e1c6ab0e..000000000 --- a/code/Modules/Gfx/pnacl/pnaclDisplayMgr.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once -//------------------------------------------------------------------------------ -/** - @class Oryol::_priv::pnaclDisplayMgr - @ingroup _priv - @brief PNaCl implementation of displayMgr -*/ -#include "Gfx/Core/displayMgrBase.h" -#include "Gfx/gl/gl_decl.h" -#include "Core/pnacl/pnaclInstance.h" - -namespace Oryol { -namespace _priv { - -class pnaclDisplayMgr : public displayMgrBase { -public: - /// constructor - pnaclDisplayMgr(); - /// destructor - ~pnaclDisplayMgr(); - - /// setup the display system, must happen before rendering - void SetupDisplay(const GfxSetup& gfxSetup, const gfxPointers& ptrs); - /// discard the display, rendering cannot happen after - void DiscardDisplay(); - /// present the current rendered frame - void Present(); - - /// bind the default frame buffer - void glBindDefaultFramebuffer(); - -private: - /// handle a view-change event from the pnaclInstance - bool handleViewEvent(const pp::View& view); - /// send a request canvas size event to the web page - void requestCanvasResize(int newWidth, int newHeight); - - int glFramebufferWidth; - int glFramebufferHeight; -}; - -} // namespace _priv -} // namespace Oryol diff --git a/code/Modules/HTTP/CMakeLists.txt b/code/Modules/HTTP/CMakeLists.txt index 4a2347a8c..c5eb97101 100644 --- a/code/Modules/HTTP/CMakeLists.txt +++ b/code/Modules/HTTP/CMakeLists.txt @@ -23,9 +23,6 @@ fips_begin_module(HTTP) elseif (FIPS_EMSCRIPTEN) fips_dir(emsc) fips_files(emscURLLoader.cc emscURLLoader.h) - elseif (FIPS_PNACL) - fips_dir(pnacl) - fips_files(pnaclURLLoader.cc pnaclURLLoader.h) endif() fips_deps(IO Core) diff --git a/code/Modules/HTTP/pnacl/pnaclURLLoader.cc b/code/Modules/HTTP/pnacl/pnaclURLLoader.cc deleted file mode 100644 index 31ee52b15..000000000 --- a/code/Modules/HTTP/pnacl/pnaclURLLoader.cc +++ /dev/null @@ -1,155 +0,0 @@ -//------------------------------------------------------------------------------ -// pnaclURLLoader.cc -//------------------------------------------------------------------------------ -#include "Pre.h" -#include "pnaclURLLoader.h" -#include "Core/pnacl/pnaclInstance.h" -#include -#include -#include -#include -#include - -namespace Oryol { -namespace _priv { - -// a helper class to wrap all request-related data into a ref-counted object -class pnaclRequestWrapper : public RefCounted { - OryolClassDecl(pnaclRequestWrapper); -public: - pnaclRequestWrapper(Ptr req) { - this->ioRequest = req; - pp::Instance* ppInst = pnaclInstance::Instance(); - this->ppUrlRequestInfo = pp::URLRequestInfo(ppInst); - this->ppUrlRequestInfo.SetMethod("GET"); - String urlPath = req->Url.PathToEnd(); - this->ppUrlRequestInfo.SetURL(urlPath.AsCStr()); - this->ppUrlLoader = pp::URLLoader(ppInst); - }; - virtual ~pnaclRequestWrapper() { - this->ioRequest = nullptr; - this->ppUrlLoader = pp::URLLoader(); - this->ppUrlRequestInfo = pp::URLRequestInfo(); - } - - void readBodyData() { - auto& responseBody = this->ioRequest->Data; - pp::CompletionCallback cc = pp::CompletionCallback(pnaclURLLoader::cbOnRead, this); - int32_t result = PP_OK; - do { - result = this->ppUrlLoader.ReadResponseBody(this->readBuffer, ReadBufferSize, cc); - if (result > 0) { - responseBody.Add(this->readBuffer, result); - } - } - while (result > 0); - if (PP_OK_COMPLETIONPENDING != result) { - cc.Run(result); - } - } - - Ptr ioRequest; - pp::URLRequestInfo ppUrlRequestInfo; - pp::URLLoader ppUrlLoader; - static const int ReadBufferSize = 4096; - uint8_t readBuffer[ReadBufferSize]; -}; - -//------------------------------------------------------------------------------ -bool -pnaclURLLoader::doRequest(const Ptr& ioReq) { - if (baseURLLoader::doRequest(ioReq)) { - this->startRequest(ioReq); - return true; - } - else { - // request was cancelled - return false; - } -} - -//------------------------------------------------------------------------------ -void -pnaclURLLoader::startRequest(const Ptr& req) { - o_assert(req.isValid() && !req->Handled); - - // bump the requests refcount and get a raw pointer - IORead* reqPtr = req.get(); - reqPtr->addRef(); - - // fire off main-thread callback to create and send the HTTP request - pp::Module::Get()->core()->CallOnMainThread(0, pp::CompletionCallback(cbSendRequest, reqPtr)); -} - -//------------------------------------------------------------------------------ -void -pnaclURLLoader::cbSendRequest(void* data, int32_t /*result*/) { - o_assert(pp::Module::Get()->core()->IsMainThread()); - - Ptr ioReq = (IORead*) data; - auto req = pnaclRequestWrapper::Create(ioReq); - ioReq->release(); - pnaclRequestWrapper* reqPtr = req.get(); - reqPtr->addRef(); - ORYOL_UNUSED int32_t openResult = req->ppUrlLoader.Open(req->ppUrlRequestInfo, pp::CompletionCallback(cbRequestComplete, reqPtr)); - o_assert(PP_OK_COMPLETIONPENDING == openResult); -} - -//------------------------------------------------------------------------------ -void -pnaclURLLoader::cbRequestComplete(void* data, int32_t result) { - o_assert(PP_OK == result); - - Ptr req((pnaclRequestWrapper*)data); - - // translate response - o_assert(!req->ppUrlLoader.is_null()); - o_assert(!req->ppUrlLoader.GetResponseInfo().is_null()); - IOStatus::Code httpStatus = (IOStatus::Code) req->ppUrlLoader.GetResponseInfo().GetStatusCode(); - req->ioRequest->Status = httpStatus; - if (httpStatus == IOStatus::OK) { - // response header received ok, start loading response body, - // first get the immediately available data now, and maybe - // do async call to fetch the rest - req->readBodyData(); - // NOTE: do not release since cbOnRead still needs the pnaclRequestWrapper! - } - else { - // HTTP error, dump a warning, and cleanup - Log::Warn("pnaclURLLoader::cbRequestComplete: GET '%s' returned with '%d'\n", - req->ioRequest->Url.AsCStr(), httpStatus); - req->ioRequest->Handled = true; - req->release(); - } -} - -//------------------------------------------------------------------------------ -void -pnaclURLLoader::cbOnRead(void* data, int32_t result) { - Ptr req((pnaclRequestWrapper*)data); - if (PP_OK == result) - { - // all data received - req->ioRequest->Handled = true; - req->release(); - } - else if (result > 0) - { - // read all available data..., do not release the pnaclRequestWrapper - // since it is still needed in the following callbacks - req->ioRequest->Data.Add(req->readBuffer, result); - req->readBodyData(); - } - else - { - // an error occurred - Log::Warn("pnaclURLLoader::cbOnRead: Error while reading body data.\n"); - req->ioRequest->Status = IOStatus::DownloadError; - req->ioRequest->Handled = true; - req->release(); - } -} - -} // namespace _priv -} // namespace Oryol - diff --git a/code/Modules/HTTP/pnacl/pnaclURLLoader.h b/code/Modules/HTTP/pnacl/pnaclURLLoader.h deleted file mode 100644 index 09af30e03..000000000 --- a/code/Modules/HTTP/pnacl/pnaclURLLoader.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once -//------------------------------------------------------------------------------ -/** - @class Oryol::_priv::pnaclURLLoader - @ingroup _priv - @brief private: PNaCl implementation of URLLoader - @see URLLoader, HTTPClient - - See the url_loader example in the NaCl SDK for details. -*/ -#include "HTTP/base/baseURLLoader.h" - -namespace Oryol { -namespace _priv { - -class pnaclURLLoader : public baseURLLoader { -public: - /// process one request - bool doRequest(const Ptr& req); - - /// pepper-thread callback which sends the request - static void cbSendRequest(void* data, int32_t result); - /// pepper-thread callback after HTTP response header has been loaded - static void cbRequestComplete(void* data, int32_t result); - /// pepper-thread callback to fetch response body - static void cbOnRead(void* data, int32_t result); - -private: - /// start the next, called from doWork - void startRequest(const Ptr& req); -}; - -} // namespace _priv -} // namespace Oryol diff --git a/code/Modules/HTTP/urlLoader.h b/code/Modules/HTTP/urlLoader.h index e4c75bfef..38ca30d00 100644 --- a/code/Modules/HTTP/urlLoader.h +++ b/code/Modules/HTTP/urlLoader.h @@ -37,12 +37,6 @@ namespace Oryol { namespace _priv { class urlLoader : public emscURLLoader {}; } } -#elif ORYOL_PNACL -#include "HTTP/pnacl/pnaclURLLoader.h" -namespace Oryol { -namespace _priv { -class urlLoader : public pnaclURLLoader {}; -} } #else #include "HTTP/base/baseURLLoader.h" namespace Oryol { diff --git a/code/Modules/IO/README.md b/code/Modules/IO/README.md index 774dcfd59..de7eb8ed4 100644 --- a/code/Modules/IO/README.md +++ b/code/Modules/IO/README.md @@ -145,7 +145,7 @@ may be instantiated multiple times in separate IO threads (where and how often a FileSystem object is instantianed is an implementation detail which differs between platforms). -> NOTE: There's one important caveat on web platforms like HTML5 or PNaCl: +> NOTE: There's one important caveat on HTML5: > both platforms are limited by the 'same-origin policy', which basically > means that a web page must only load assets from the same domain it was > served from. For this reason, the current implementation of HTTPFileSystem diff --git a/code/Modules/Input/CMakeLists.txt b/code/Modules/Input/CMakeLists.txt index 44e567cf1..2789bfc14 100644 --- a/code/Modules/Input/CMakeLists.txt +++ b/code/Modules/Input/CMakeLists.txt @@ -40,10 +40,6 @@ fips_begin_module(Input) fips_files(iosInputMgr.mm iosInputMgr.h) fips_frameworks_osx(CoreMotion) endif() - if (FIPS_PNACL) - fips_dir(pnacl) - fips_files(pnaclInputMgr.cc pnaclInputMgr.h) - endif() if (ORYOL_OPENGL) if (FIPS_RASPBERRYPI) fips_dir(raspi) diff --git a/code/Modules/Input/Core/inputMgr.h b/code/Modules/Input/Core/inputMgr.h index c69880e7e..612be033f 100644 --- a/code/Modules/Input/Core/inputMgr.h +++ b/code/Modules/Input/Core/inputMgr.h @@ -41,12 +41,6 @@ namespace Oryol { namespace _priv { class inputMgr : public emscInputMgr { }; } } -#elif ORYOL_PNACL -#include "Input/pnacl/pnaclInputMgr.h" -namespace Oryol { -namespace _priv { -class inputMgr : public pnaclInputMgr { }; -} } #elif ORYOL_ANDROID #include "Input/android/androidInputMgr.h" namespace Oryol { diff --git a/code/Modules/Input/README.md b/code/Modules/Input/README.md index c67809a4d..6bfcad6d5 100644 --- a/code/Modules/Input/README.md +++ b/code/Modules/Input/README.md @@ -15,7 +15,6 @@ iOS | - | - | - | YES | YES Android | - | - | - | YES | YES HTML5 (desktop) | YES | YES | YES | - | - HTML5 (mobile) | - | - | - | YES | YES -PNaCl | YES | YES | - | - | - RaspberryPi | YES | YES | - | - | - > NOTE: gamepad support on OSX and Windows is currently only diff --git a/code/Modules/Input/pnacl/pnaclInputMgr.cc b/code/Modules/Input/pnacl/pnaclInputMgr.cc deleted file mode 100644 index 55b578629..000000000 --- a/code/Modules/Input/pnacl/pnaclInputMgr.cc +++ /dev/null @@ -1,307 +0,0 @@ -//------------------------------------------------------------------------------ -// pnaclInputMgr.cc -//------------------------------------------------------------------------------ -#include "Pre.h" -#include "pnaclInputMgr.h" -#include "Core/Core.h" -#include "Core/pnacl/pnaclInstance.h" -#include "Core/String/StringConverter.h" - -namespace Oryol { -namespace _priv { - -//------------------------------------------------------------------------------ -pnaclInputMgr::pnaclInputMgr() : -runLoopId(RunLoop::InvalidId) { - // empty -} - -//------------------------------------------------------------------------------ -pnaclInputMgr::~pnaclInputMgr() { - // empty -} - -//------------------------------------------------------------------------------ -void -pnaclInputMgr::setup(const InputSetup& setup) { - inputMgrBase::setup(setup); - this->keyboard.attached = true; - this->mouse.attached = true; - this->setupKeyTable(); - - pnaclInstance::Instance()->enableInput([this] (const pp::InputEvent& e) { - return this->handleEvent(e); - }); - this->runLoopId = Core::PostRunLoop()->Add([this]() { this->reset(); }); -} - -//------------------------------------------------------------------------------ -void -pnaclInputMgr::discard() { - Core::PostRunLoop()->Remove(this->runLoopId); - this->runLoopId = RunLoop::InvalidId; - inputMgrBase::discard(); -} - -//------------------------------------------------------------------------------ -bool -pnaclInputMgr::handleEvent(const pp::InputEvent& ie) { - - switch (ie.GetType()) - { - case PP_INPUTEVENT_TYPE_MOUSEDOWN: - return this->onMouseDown(pp::MouseInputEvent(ie)); - - case PP_INPUTEVENT_TYPE_MOUSEUP: - return this->onMouseUp(pp::MouseInputEvent(ie)); - - case PP_INPUTEVENT_TYPE_MOUSEMOVE: - return this->onMouseMove(pp::MouseInputEvent(ie)); - - case PP_INPUTEVENT_TYPE_MOUSEENTER: - return this->onMouseEnter(pp::MouseInputEvent(ie)); - - case PP_INPUTEVENT_TYPE_MOUSELEAVE: - return this->onMouseLeave(pp::MouseInputEvent(ie)); - - case PP_INPUTEVENT_TYPE_WHEEL: - return this->onWheel(pp::WheelInputEvent(ie)); - - case PP_INPUTEVENT_TYPE_KEYDOWN: - return this->onKeyDown(pp::KeyboardInputEvent(ie)); - - case PP_INPUTEVENT_TYPE_KEYUP: - return this->onKeyUp(pp::KeyboardInputEvent(ie)); - - case PP_INPUTEVENT_TYPE_CHAR: - return this->onChar(pp::KeyboardInputEvent(ie)); - - default: - return false; - } -} - -//------------------------------------------------------------------------------ -MouseButton::Code -pnaclInputMgr::mapMouseButton(PP_InputEvent_MouseButton naclBtn) { - switch (naclBtn) { - case PP_INPUTEVENT_MOUSEBUTTON_LEFT: return MouseButton::Left; - case PP_INPUTEVENT_MOUSEBUTTON_MIDDLE: return MouseButton::Middle; - case PP_INPUTEVENT_MOUSEBUTTON_RIGHT: return MouseButton::Right; - default: return MouseButton::InvalidMouseButton; - } -} - -//------------------------------------------------------------------------------ -bool -pnaclInputMgr::onMouseDown(const pp::MouseInputEvent& ie) { - MouseButton::Code btn = this->mapMouseButton(ie.GetButton()); - if (MouseButton::InvalidMouseButton != btn) { - this->mouse.onButtonDown(btn); - return true; - } - return false; -} - -//------------------------------------------------------------------------------ -bool -pnaclInputMgr::onMouseUp(const pp::MouseInputEvent& ie) { - MouseButton::Code btn = this->mapMouseButton(ie.GetButton()); - if (MouseButton::InvalidMouseButton != btn) { - this->mouse.onButtonUp(btn); - return true; - } - return false; -} - -//------------------------------------------------------------------------------ -bool -pnaclInputMgr::onMouseMove(const pp::MouseInputEvent& ie) { - pp::Point pos = ie.GetPosition(); - pp::Point mov = ie.GetMovement(); - this->mouse.onPosMov(glm::vec2(pos.x(), pos.y()), glm::vec2(mov.x(), mov.y())); - return true; -} - -//------------------------------------------------------------------------------ -bool -pnaclInputMgr::onMouseEnter(const pp::MouseInputEvent& ie) { - return false; -} - -//------------------------------------------------------------------------------ -bool -pnaclInputMgr::onMouseLeave(const pp::MouseInputEvent& ie) { - return false; -} - -//------------------------------------------------------------------------------ -bool -pnaclInputMgr::onWheel(const pp::WheelInputEvent& ie) { - const pp::FloatPoint pos = ie.GetDelta(); - this->mouse.onScroll(glm::vec2(pos.x(), pos.y())); - return true; -} - -//------------------------------------------------------------------------------ -bool -pnaclInputMgr::onKeyDown(const pp::KeyboardInputEvent& ie) { - const Key::Code key = this->mapKey(ie.GetKeyCode()); - if (Key::InvalidKey != key) { - this->keyboard.onKeyDown(key); - return true; - } - return false; -} - -//------------------------------------------------------------------------------ -bool -pnaclInputMgr::onKeyUp(const pp::KeyboardInputEvent& ie) { - const Key::Code key = this->mapKey(ie.GetKeyCode()); - if (Key::InvalidKey != key) { - this->keyboard.onKeyUp(key); - return true; - } - return false; -} - -//------------------------------------------------------------------------------ -bool -pnaclInputMgr::onChar(const pp::KeyboardInputEvent& ie) { - std::string str = ie.GetCharacterText().AsString(); - const size_t len = str.length(); - if (len > 0) { - static wchar_t wide[32] = { 0 }; - const unsigned char* src = (const unsigned char*) str.c_str(); - const int wlen = StringConverter::UTF8ToWide(src, len, wide, sizeof(wide)); - if (wlen > 0) { - this->keyboard.onChar(wide[0]); - } - } - return false; -} - -//------------------------------------------------------------------------------ -Key::Code -pnaclInputMgr::mapKey(uint32_t naclKeyCode) const { - if (naclKeyCode < MaxNumKeys) { - return this->keyTable[naclKeyCode]; - } - else { - return Key::InvalidKey; - } -} - -//------------------------------------------------------------------------------ -void -pnaclInputMgr::setupKeyTable() { - - // looks like the keycodes are identical with JS - for (int i = 0; i < MaxNumKeys; i++) { - this->keyTable[i] = Key::InvalidKey; - } - - this->keyTable[8] = Key::BackSpace; - this->keyTable[9] = Key::Tab; - this->keyTable[13] = Key::Enter; - this->keyTable[16] = Key::LeftShift; - this->keyTable[17] = Key::LeftControl; - this->keyTable[18] = Key::LeftAlt; - this->keyTable[19] = Key::Pause; - this->keyTable[27] = Key::Escape; - this->keyTable[32] = Key::Space; - this->keyTable[33] = Key::PageUp; - this->keyTable[34] = Key::PageDown; - this->keyTable[35] = Key::End; - this->keyTable[36] = Key::Home; - this->keyTable[37] = Key::Left; - this->keyTable[38] = Key::Up; - this->keyTable[39] = Key::Right; - this->keyTable[40] = Key::Down; - this->keyTable[45] = Key::Insert; - this->keyTable[46] = Key::Delete; - this->keyTable[48] = Key::N0; - this->keyTable[49] = Key::N1; - this->keyTable[50] = Key::N2; - this->keyTable[51] = Key::N3; - this->keyTable[52] = Key::N4; - this->keyTable[53] = Key::N5; - this->keyTable[54] = Key::N6; - this->keyTable[55] = Key::N7; - this->keyTable[56] = Key::N8; - this->keyTable[57] = Key::N9; - this->keyTable[59] = Key::Semicolon; - this->keyTable[64] = Key::Equal; - this->keyTable[65] = Key::A; - this->keyTable[66] = Key::B; - this->keyTable[67] = Key::C; - this->keyTable[68] = Key::D; - this->keyTable[69] = Key::E; - this->keyTable[70] = Key::F; - this->keyTable[71] = Key::G; - this->keyTable[72] = Key::H; - this->keyTable[73] = Key::I; - this->keyTable[74] = Key::J; - this->keyTable[75] = Key::K; - this->keyTable[76] = Key::L; - this->keyTable[77] = Key::M; - this->keyTable[78] = Key::N; - this->keyTable[79] = Key::O; - this->keyTable[80] = Key::P; - this->keyTable[81] = Key::Q; - this->keyTable[82] = Key::R; - this->keyTable[83] = Key::S; - this->keyTable[84] = Key::T; - this->keyTable[85] = Key::U; - this->keyTable[86] = Key::V; - this->keyTable[87] = Key::W; - this->keyTable[88] = Key::X; - this->keyTable[89] = Key::Y; - this->keyTable[90] = Key::Z; - this->keyTable[93] = Key::Menu; - this->keyTable[96] = Key::Num0; - this->keyTable[97] = Key::Num1; - this->keyTable[98] = Key::Num2; - this->keyTable[99] = Key::Num3; - this->keyTable[100] = Key::Num4; - this->keyTable[101] = Key::Num5; - this->keyTable[102] = Key::Num6; - this->keyTable[103] = Key::Num7; - this->keyTable[104] = Key::Num8; - this->keyTable[105] = Key::Num9; - this->keyTable[106] = Key::NumMultiply; - this->keyTable[107] = Key::NumAdd; - this->keyTable[109] = Key::NumSubtract; - this->keyTable[110] = Key::NumDecimal; - this->keyTable[111] = Key::NumDivide; - this->keyTable[112] = Key::F1; - this->keyTable[113] = Key::F2; - this->keyTable[114] = Key::F3; - this->keyTable[115] = Key::F4; - this->keyTable[116] = Key::F5; - this->keyTable[117] = Key::F6; - this->keyTable[118] = Key::F7; - this->keyTable[119] = Key::F8; - this->keyTable[120] = Key::F9; - this->keyTable[121] = Key::F10; - this->keyTable[122] = Key::F11; - this->keyTable[123] = Key::F12; - this->keyTable[144] = Key::NumLock; - this->keyTable[145] = Key::ScrollLock; - this->keyTable[173] = Key::Minus; - this->keyTable[186] = Key::Semicolon; - this->keyTable[187] = Key::Equal; - this->keyTable[188] = Key::Comma; - this->keyTable[189] = Key::Minus; - this->keyTable[190] = Key::Period; - this->keyTable[191] = Key::Slash; - this->keyTable[192] = Key::GraveAccent; - this->keyTable[219] = Key::LeftBracket; - this->keyTable[220] = Key::BackSlash; - this->keyTable[221] = Key::RightBracket; - this->keyTable[222] = Key::Apostrophe; - this->keyTable[224] = Key::LeftSuper; -} - -} // namespace _priv -} // namespace Oryol diff --git a/code/Modules/Input/pnacl/pnaclInputMgr.h b/code/Modules/Input/pnacl/pnaclInputMgr.h deleted file mode 100644 index 3e2bf0cd0..000000000 --- a/code/Modules/Input/pnacl/pnaclInputMgr.h +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once -//------------------------------------------------------------------------------ -/** - @class Oryol::_priv::pnaclInputMgr - @brief PNaCl platform input manager class -*/ -#include "Input/Core/inputMgrBase.h" -#include "ppapi/cpp/input_event.h" -#include "Core/RunLoop.h" - -namespace Oryol { -namespace _priv { - -class pnaclInputMgr : public inputMgrBase { -public: - /// constructor - pnaclInputMgr(); - /// destructor - ~pnaclInputMgr(); - - /// setup the input manager - void setup(const InputSetup& setup); - /// discard the input manager - void discard(); - -private: - /// setup the key code mapping table - void setupKeyTable(); - /// convert nacl key code to oryol key code - Key::Code mapKey(uint32_t naclKeyCode) const; - /// map NaCl mouse button to Oryol mouse button - MouseButton::Code mapMouseButton(PP_InputEvent_MouseButton naclBtn); - /// input event callback from pnaclInstance::HandleInputEvent - bool handleEvent(const pp::InputEvent& ie); - /// called on mouse-down event from handleEvent - bool onMouseDown(const pp::MouseInputEvent& ie); - /// called on mouse-up event from handleEvent - bool onMouseUp(const pp::MouseInputEvent& ie); - /// called on mouse-move event from handleEvent - bool onMouseMove(const pp::MouseInputEvent& ie); - /// called on mouse-enter event from handleEvent - bool onMouseEnter(const pp::MouseInputEvent& ie); - /// called on mouse-leave event from handleEvent - bool onMouseLeave(const pp::MouseInputEvent& ie); - /// called on mouse wheel event from handleEvent - bool onWheel(const pp::WheelInputEvent& ie); - /// called on key-down event from handleEvent - bool onKeyDown(const pp::KeyboardInputEvent& ie); - /// called on key-up event from handleEvent - bool onKeyUp(const pp::KeyboardInputEvent& ie); - /// called on char event from handleEvent - bool onChar(const pp::KeyboardInputEvent& ie); - - static const int MaxNumKeys = 256; - RunLoop::Id runLoopId; - Key::Code keyTable[MaxNumKeys]; -}; - -} // namespace _priv -} // namespace Oryol - diff --git a/code/Modules/LocalFS/CMakeLists.txt b/code/Modules/LocalFS/CMakeLists.txt index e9c2cba7a..a4d07f68c 100644 --- a/code/Modules/LocalFS/CMakeLists.txt +++ b/code/Modules/LocalFS/CMakeLists.txt @@ -10,11 +10,11 @@ fips_begin_module(LocalFS) LocalFileSystem.cc LocalFileSystem.h ) fips_dir(whereami) - if (NOT FIPS_UWP AND NOT FIPS_EMSCRIPTEN AND NOT FIPS_PNACL) + if (NOT FIPS_UWP AND NOT FIPS_EMSCRIPTEN) fips_files(whereami_oryol.cc whereami.h) endif() # web-platforms don't have a LocalFS implementation - if (FIPS_EMSCRIPTEN OR FIPS_PNACL) + if (FIPS_EMSCRIPTEN) fips_dir(dummy) fips_files(dummyFSWrapper.cc dummyFSWrapper.h) else() diff --git a/code/Modules/LocalFS/Core/fsWrapper.h b/code/Modules/LocalFS/Core/fsWrapper.h index 274b39fdc..519159b8e 100644 --- a/code/Modules/LocalFS/Core/fsWrapper.h +++ b/code/Modules/LocalFS/Core/fsWrapper.h @@ -6,7 +6,7 @@ @brief file-system wrapper frontend class */ -#if ORYOL_EMSCRIPTEN || ORYOL_PNACL +#if ORYOL_EMSCRIPTEN #include "LocalFS/dummy/dummyFSWrapper.h" namespace Oryol { namespace _priv { diff --git a/code/Samples/BlendTest/CMakeLists.txt b/code/Samples/BlendTest/CMakeLists.txt index f7b320f0b..93629489e 100644 --- a/code/Samples/BlendTest/CMakeLists.txt +++ b/code/Samples/BlendTest/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(BlendTest windowed) fips_files(BlendTest.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets) - oryol_add_web_sample(BlendTest "Test BlendState implementation" "emscripten,android,pnacl" BlendTest.jpg "BlendTest/BlendTest.cc") + oryol_add_web_sample(BlendTest "Test BlendState implementation" "emscripten,android" BlendTest.jpg "BlendTest/BlendTest.cc") fips_end_app() diff --git a/code/Samples/Clear/CMakeLists.txt b/code/Samples/Clear/CMakeLists.txt index ab3a4f6fe..88cf00d53 100644 --- a/code/Samples/Clear/CMakeLists.txt +++ b/code/Samples/Clear/CMakeLists.txt @@ -2,5 +2,5 @@ fips_begin_app(Clear windowed) fips_vs_warning_level(3) fips_files(Clear.cc Clear.jpg) fips_deps(Gfx) - oryol_add_web_sample(Clear "Just call glClear in a loop" "emscripten,pnacl,android" Clear.jpg "Clear/Clear.cc") + oryol_add_web_sample(Clear "Just call glClear in a loop" "emscripten" Clear.jpg "Clear/Clear.cc") fips_end_app() diff --git a/code/Samples/DDSCubeMap/CMakeLists.txt b/code/Samples/DDSCubeMap/CMakeLists.txt index 66cb253c9..071aecb1e 100644 --- a/code/Samples/DDSCubeMap/CMakeLists.txt +++ b/code/Samples/DDSCubeMap/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(DDSCubeMap windowed) fips_files(DDSCubeMap.cc) oryol_shader(shaders.shd) fips_deps(Assets Gfx HTTP) - oryol_add_web_sample(DDSCubeMap "Load and display DDS DXT1 cube map" "emscripten,pnacl" DDSCubeMap.jpg "DDSCubeMap/DDSCubeMap.cc") + oryol_add_web_sample(DDSCubeMap "Load and display DDS DXT1 cube map" "emscripten" DDSCubeMap.jpg "DDSCubeMap/DDSCubeMap.cc") fips_end_app() diff --git a/code/Samples/DDSTextureLoading/CMakeLists.txt b/code/Samples/DDSTextureLoading/CMakeLists.txt index b0c1349b9..e24479a27 100644 --- a/code/Samples/DDSTextureLoading/CMakeLists.txt +++ b/code/Samples/DDSTextureLoading/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(DDSTextureLoading windowed) fips_files(DDSTextureLoading.cc) oryol_shader(shaders.shd) fips_deps(Assets Gfx HTTP) - oryol_add_web_sample(DDSTextureLoading "Load and render various DDS texture formats" "emscripten,pnacl,android" DDSTextureLoading.jpg "DDSTextureLoading/DDSTextureLoading.cc") + oryol_add_web_sample(DDSTextureLoading "Load and render various DDS texture formats" "emscripten" DDSTextureLoading.jpg "DDSTextureLoading/DDSTextureLoading.cc") fips_end_app() diff --git a/code/Samples/DebugText/CMakeLists.txt b/code/Samples/DebugText/CMakeLists.txt index 94e82a177..f8fc1af06 100644 --- a/code/Samples/DebugText/CMakeLists.txt +++ b/code/Samples/DebugText/CMakeLists.txt @@ -2,5 +2,5 @@ fips_begin_app(DebugText windowed) fips_vs_warning_level(3) fips_files(DebugText.cc) fips_deps(Core Gfx Dbg) - oryol_add_web_sample(DebugText "Demonstrate debug text rendering" "emscripten,pnacl,android" DebugText.jpg "DebugText/DebugText.cc") + oryol_add_web_sample(DebugText "Demonstrate debug text rendering" "emscripten" DebugText.jpg "DebugText/DebugText.cc") fips_end_app() diff --git a/code/Samples/DrawCallPerf/CMakeLists.txt b/code/Samples/DrawCallPerf/CMakeLists.txt index 51b5e95d9..bdb7504f7 100644 --- a/code/Samples/DrawCallPerf/CMakeLists.txt +++ b/code/Samples/DrawCallPerf/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(DrawCallPerf windowed) fips_files(DrawCallPerf.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets Dbg Input) - oryol_add_web_sample(DrawCallPerf "Measure draw call performance" "emscripten,pnacl,android" DrawCallPerf.jpg "DrawCallPerf/DrawCallPerf.cc") + oryol_add_web_sample(DrawCallPerf "Measure draw call performance" "emscripten" DrawCallPerf.jpg "DrawCallPerf/DrawCallPerf.cc") fips_end_app() diff --git a/code/Samples/FullscreenQuad/CMakeLists.txt b/code/Samples/FullscreenQuad/CMakeLists.txt index 491989c0a..e7cef464a 100644 --- a/code/Samples/FullscreenQuad/CMakeLists.txt +++ b/code/Samples/FullscreenQuad/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(FullscreenQuad windowed) fips_files(FullscreenQuad.cc) oryol_shader(shaders.shd) fips_deps(Gfx) - oryol_add_web_sample(FullscreenQuad "Fullscreen quad with some distance field ray-marching" "emscripten,pnacl,android" FullscreenQuad.jpg "FullscreenQuad/FullscreenQuad.cc") + oryol_add_web_sample(FullscreenQuad "Fullscreen quad with some distance field ray-marching" "emscripten" FullscreenQuad.jpg "FullscreenQuad/FullscreenQuad.cc") fips_end_app() diff --git a/code/Samples/GPUParticles/CMakeLists.txt b/code/Samples/GPUParticles/CMakeLists.txt index fd99e7b07..3bba4b996 100644 --- a/code/Samples/GPUParticles/CMakeLists.txt +++ b/code/Samples/GPUParticles/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(GPUParticles windowed) fips_files(GPUParticles.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets Dbg) - oryol_add_web_sample(GPUParticles "Fully GPU driven 3D particles" "emscripten,android,pnacl" GPUParticles.jpg "GPUParticles/GPUParticles.cc") + oryol_add_web_sample(GPUParticles "Fully GPU driven 3D particles" "emscripten" GPUParticles.jpg "GPUParticles/GPUParticles.cc") fips_end_app() diff --git a/code/Samples/IOQueueSample/CMakeLists.txt b/code/Samples/IOQueueSample/CMakeLists.txt index 619bb7cf7..1cbd2b6f4 100644 --- a/code/Samples/IOQueueSample/CMakeLists.txt +++ b/code/Samples/IOQueueSample/CMakeLists.txt @@ -2,5 +2,5 @@ fips_begin_app(IOQueueSample windowed) fips_vs_warning_level(3) fips_files(IOQueueSample.cc) fips_deps(IO HTTP) - oryol_add_web_sample(IOQueueSample "Asynchronous file loading with IOQueue" "emscripten,pnacl" none "IOQueueSample/IOQueueSample.cc") + oryol_add_web_sample(IOQueueSample "Asynchronous file loading with IOQueue" "emscripten" none "IOQueueSample/IOQueueSample.cc") fips_end_app() diff --git a/code/Samples/InfiniteSpheres/CMakeLists.txt b/code/Samples/InfiniteSpheres/CMakeLists.txt index 13eb95721..5c0428810 100644 --- a/code/Samples/InfiniteSpheres/CMakeLists.txt +++ b/code/Samples/InfiniteSpheres/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(InfiniteSpheres windowed) fips_files(InfiniteSpheres.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets) - oryol_add_web_sample(InfiniteSpheres "Infinite recursive spheres" "emscripten,android,pnacl" InfiniteSpheres.jpg "InfiniteSpheres/InfiniteSpheres.cc") + oryol_add_web_sample(InfiniteSpheres "Infinite recursive spheres" "emscripten" InfiniteSpheres.jpg "InfiniteSpheres/InfiniteSpheres.cc") fips_end_app() diff --git a/code/Samples/Instancing/CMakeLists.txt b/code/Samples/Instancing/CMakeLists.txt index b46ee5d36..e5cc4d8fc 100644 --- a/code/Samples/Instancing/CMakeLists.txt +++ b/code/Samples/Instancing/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(Instancing windowed) fips_files(Instancing.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets Dbg Input) - oryol_add_web_sample(Instancing "Instanced rendering" "emscripten,pnacl,android" Instancing.jpg "Instancing/Instancing.cc") + oryol_add_web_sample(Instancing "Instanced rendering" "emscripten" Instancing.jpg "Instancing/Instancing.cc") fips_end_app() diff --git a/code/Samples/MultipleRenderTarget/CMakeLists.txt b/code/Samples/MultipleRenderTarget/CMakeLists.txt index fa389390f..dd15b4cbc 100644 --- a/code/Samples/MultipleRenderTarget/CMakeLists.txt +++ b/code/Samples/MultipleRenderTarget/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(MultipleRenderTarget windowed) fips_files(MultipleRenderTarget.cc) oryol_shader(shaders.shd) fips_deps(Gfx Dbg Assets) - oryol_add_web_sample(MultipleRenderTarget "Demonstrate MRT rendering" "emscripten,android,pnacl" MultipleRenderTarget.jpg "MultipleRenderTarget/MultipleTarget.cc") + oryol_add_web_sample(MultipleRenderTarget "Demonstrate MRT rendering" "emscripten" MultipleRenderTarget.jpg "MultipleRenderTarget/MultipleTarget.cc") fips_end_app() diff --git a/code/Samples/NativeTexture/CMakeLists.txt b/code/Samples/NativeTexture/CMakeLists.txt index dae86208c..e9c099390 100644 --- a/code/Samples/NativeTexture/CMakeLists.txt +++ b/code/Samples/NativeTexture/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(NativeTexture windowed) fips_files(NativeTexture.cc) oryol_shader(shaders.shd) fips_deps(Gfx Dbg Assets) - oryol_add_web_sample(NativeTexture "Demonstrates native 3D-API texture usage" "emscripten,pnacl,android" NativeTexture.jpg "NativeTexture/NativeTexture.cc") + oryol_add_web_sample(NativeTexture "Demonstrates native 3D-API texture usage" "emscripten" NativeTexture.jpg "NativeTexture/NativeTexture.cc") fips_end_app() diff --git a/code/Samples/PackedNormals/CMakeLists.txt b/code/Samples/PackedNormals/CMakeLists.txt index 40c908370..911a10f2d 100644 --- a/code/Samples/PackedNormals/CMakeLists.txt +++ b/code/Samples/PackedNormals/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(PackedNormals windowed) fips_files(PackedNormals.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets) - oryol_add_web_sample(PackedNormals "Shapes with packed vertex normals" "emscripten,android,pnacl" PackedNormals.jpg "PackedNormals/PackedNormals.cc") + oryol_add_web_sample(PackedNormals "Shapes with packed vertex normals" "emscripten" PackedNormals.jpg "PackedNormals/PackedNormals.cc") fips_end_app() diff --git a/code/Samples/PrimitiveTypes/CMakeLists.txt b/code/Samples/PrimitiveTypes/CMakeLists.txt index 270cb815d..639a16e10 100644 --- a/code/Samples/PrimitiveTypes/CMakeLists.txt +++ b/code/Samples/PrimitiveTypes/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(PrimitiveTypes windowed) fips_files(PrimitiveTypes.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets Dbg Input) - oryol_add_web_sample(PrimitiveTypes "Test Gfx primitive types" "emscripten,pnacl,android" "PrimitiveTypes.jpg" "PrimitiveTypes/PrimitiveTypes.cc") + oryol_add_web_sample(PrimitiveTypes "Test Gfx primitive types" "emscripten" "PrimitiveTypes.jpg" "PrimitiveTypes/PrimitiveTypes.cc") fips_end_app() diff --git a/code/Samples/Quad/CMakeLists.txt b/code/Samples/Quad/CMakeLists.txt index 4c801198e..a932b2dd8 100644 --- a/code/Samples/Quad/CMakeLists.txt +++ b/code/Samples/Quad/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(Quad windowed) fips_files(Quad.cc) oryol_shader(shaders.shd) fips_deps(Gfx) - oryol_add_web_sample(Quad "Render a quad with vertex-indices" "emscripten,android,pnacl" Quad.jpg "Quad/Quad.cc") + oryol_add_web_sample(Quad "Render a quad with vertex-indices" "emscripten" Quad.jpg "Quad/Quad.cc") fips_end_app() diff --git a/code/Samples/ResourceStress/CMakeLists.txt b/code/Samples/ResourceStress/CMakeLists.txt index 21a34e24e..bd76dfd31 100644 --- a/code/Samples/ResourceStress/CMakeLists.txt +++ b/code/Samples/ResourceStress/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(ResourceStress windowed) fips_files(ResourceStress.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets HTTP Dbg) - oryol_add_web_sample(ResourceStress "Resource loading stresstest" "emscripten,pnacl,android" none "ResourceStress/ResourceStress.cc") + oryol_add_web_sample(ResourceStress "Resource loading stresstest" "emscripten" none "ResourceStress/ResourceStress.cc") fips_end_app() diff --git a/code/Samples/Sensors/CMakeLists.txt b/code/Samples/Sensors/CMakeLists.txt index 22a7220c8..c06a5bb80 100644 --- a/code/Samples/Sensors/CMakeLists.txt +++ b/code/Samples/Sensors/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(Sensors windowed) fips_files(Sensors.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets Dbg Input) - oryol_add_web_sample(Sensors "Device sensors sample" "emscripten,android" none "Sensors/Sensors.cc") + oryol_add_web_sample(Sensors "Device sensors sample" "emscripten" none "Sensors/Sensors.cc") fips_end_app() diff --git a/code/Samples/Shapes/CMakeLists.txt b/code/Samples/Shapes/CMakeLists.txt index 055c76793..248c99a25 100644 --- a/code/Samples/Shapes/CMakeLists.txt +++ b/code/Samples/Shapes/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(Shapes windowed) fips_files(Shapes.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets) - oryol_add_web_sample(Shapes "Shapes with random vertex colors, created with ShapeBuilder class" "emscripten,pnacl,android" Shapes.jpg "Shapes/Shapes.cc") + oryol_add_web_sample(Shapes "Shapes with random vertex colors, created with ShapeBuilder class" "emscripten" Shapes.jpg "Shapes/Shapes.cc") fips_end_app() diff --git a/code/Samples/SimpleRenderTarget/CMakeLists.txt b/code/Samples/SimpleRenderTarget/CMakeLists.txt index 1c6e809c9..6f58eb18f 100644 --- a/code/Samples/SimpleRenderTarget/CMakeLists.txt +++ b/code/Samples/SimpleRenderTarget/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(SimpleRenderTarget windowed) fips_files(SimpleRenderTarget.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets) - oryol_add_web_sample(SimpleRenderTarget "Demonstrate simple offscreen rendering" "emscripten,android,pnacl" SimpleRenderTarget.jpg "SimpleRenderTarget/SimpleRenderTarget.cc") + oryol_add_web_sample(SimpleRenderTarget "Demonstrate simple offscreen rendering" "emscripten" SimpleRenderTarget.jpg "SimpleRenderTarget/SimpleRenderTarget.cc") fips_end_app() diff --git a/code/Samples/TestInput/CMakeLists.txt b/code/Samples/TestInput/CMakeLists.txt index eaee922af..02c251dcc 100644 --- a/code/Samples/TestInput/CMakeLists.txt +++ b/code/Samples/TestInput/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(TestInput windowed) fips_files(TestInput.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets Dbg Input) - oryol_add_web_sample(TestInput "Test Input module functionality" "emscripten,pnacl,android" TestInput.jpg "TestInput/TestInput.cc") + oryol_add_web_sample(TestInput "Test Input module functionality" "emscripten" TestInput.jpg "TestInput/TestInput.cc") fips_end_app() diff --git a/code/Samples/TextureFloat/CMakeLists.txt b/code/Samples/TextureFloat/CMakeLists.txt index 364a2488f..47097d063 100644 --- a/code/Samples/TextureFloat/CMakeLists.txt +++ b/code/Samples/TextureFloat/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(TextureFloat windowed) fips_files(TextureFloat.cc) oryol_shader(shaders.shd) fips_deps(Gfx Dbg) - oryol_add_web_sample(TextureFloat "RGB plasma using float render texture" "emscripten,android,pnacl" TextureFloat.jpg "TextureFloat/TextureFloat.cc") + oryol_add_web_sample(TextureFloat "RGB plasma using float render texture" "emscripten" TextureFloat.jpg "TextureFloat/TextureFloat.cc") fips_end_app() diff --git a/code/Samples/Triangle/CMakeLists.txt b/code/Samples/Triangle/CMakeLists.txt index d78e26e4d..01d81ce33 100644 --- a/code/Samples/Triangle/CMakeLists.txt +++ b/code/Samples/Triangle/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(Triangle windowed) fips_files(Triangle.cc) oryol_shader(shaders.shd) fips_deps(Gfx) - oryol_add_web_sample(Triangle "The canonical triangle demo" "emscripten,android,pnacl" Triangle.jpg "Triangle/Triangle.cc") + oryol_add_web_sample(Triangle "The canonical triangle demo" "emscripten" Triangle.jpg "Triangle/Triangle.cc") fips_end_app() diff --git a/code/Samples/VertexTexture/CMakeLists.txt b/code/Samples/VertexTexture/CMakeLists.txt index 1b5abdc09..3ee7c906f 100644 --- a/code/Samples/VertexTexture/CMakeLists.txt +++ b/code/Samples/VertexTexture/CMakeLists.txt @@ -3,5 +3,5 @@ fips_begin_app(VertexTexture windowed) fips_files(VertexTexture.cc) oryol_shader(shaders.shd) fips_deps(Gfx Assets Dbg) - oryol_add_web_sample(VertexTexture "Vertex texture fetch from offscreen render target" "emscripten,android,pnacl" VertexTexture.jpg "VertexTexture/VertexTexture.cc") + oryol_add_web_sample(VertexTexture "Vertex texture fetch from offscreen render target" "emscripten" VertexTexture.jpg "VertexTexture/VertexTexture.cc") fips_end_app() diff --git a/doc/BUILD.md b/doc/BUILD.md index 53f5f6c6c..3c3e2f2e8 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -126,25 +126,6 @@ Running the Triangle sample will start a local web server and launch the sample in the default web browser. It may be necessary to manually refresh the browser page (F5). -#### Portable Native Client (PNaCl): - -Building for PNaCl is currently only supported on OSX and Linux. - -**Linux Note**: on Linux you need to the 32-bit C runtime libs first, e.g. on -a Debian based distribution: - -* sudo apt-get install lib32stdc++6 - -```bash -> cd oryol -> ./fips setup nacl -... -> ./fips build pnacl-make-release -... -> ./fips run Triangle pnacl-make-release -> _ -``` - #### iOS To compile and debug Oryol directly in Xcode (provided iOS development @@ -176,8 +157,7 @@ with fips. ### Building the Web Samples HTML page -To build the complete samples web page (provided you have a working emscripten, -PNaCl and Android SDK installation): +To build the complete samples web page (provided you have a working emscripten installation): ``` > cd oryol diff --git a/doc/OVERVIEW.md b/doc/OVERVIEW.md index 247e00d61..18b4adb6e 100644 --- a/doc/OVERVIEW.md +++ b/doc/OVERVIEW.md @@ -4,7 +4,7 @@ Let's get the bullet-point checklist out of the way first :) -- currently runs on iOS, Android, emscripten, PNaCl, Win32, Win64 (not WinRT), OSX and Linux +- currently runs on iOS, Android, emscripten, Win32, Win64 (not UWP), OSX and Linux with some features lagging behind on some platforms - builds on Linux, OSX, Windows with native IDE support (QtCreator, Xcode, VStudio) - cmake based build system with a frontend python script diff --git a/fips-include.cmake b/fips-include.cmake index 2858b6c72..396fc3703 100644 --- a/fips-include.cmake +++ b/fips-include.cmake @@ -1,6 +1,10 @@ # absolute path to Oryol set(ORYOL_DIR ${CMAKE_CURRENT_LIST_DIR}) +if (FIPS_PNACL) + message(FATAL_ERROR "PNaCl support has been removed from Oryol") +endif() + # cmake options option(ORYOL_SAMPLES "Build Oryol samples" ON) set(ORYOL_SAMPLE_URL "http://floooh.github.com/oryol/data/" CACHE STRING "Sample data URL") @@ -68,8 +72,6 @@ if (NOT ORYOL_METAL AND NOT ORYOL_D3D11) set(ORYOL_OPENGL_CORE_PROFILE 1) elseif (FIPS_IOS) set(ORYOL_OPENGLES3 1) - elseif (FIPS_PNACL) - set(ORYOL_OPENGLES2 1) elseif (FIPS_EMSCRIPTEN) if (FIPS_EMSCRIPTEN_USE_WEBGL2) set(ORYOL_OPENGLES3 1) @@ -102,9 +104,6 @@ if (FIPS_POSIX) add_definitions(-DORYOL_IOS=1) endif() endif() - if (FIPS_PNACL) - add_definitions(-DORYOL_PNACL=1) - endif() if (FIPS_EMSCRIPTEN) add_definitions(-DORYOL_EMSCRIPTEN=1) endif() @@ -183,7 +182,7 @@ endif() if (FIPS_FORCE_NO_THREADS) add_definitions(-DORYOL_FORCE_NO_THREADS=1) endif() -if (FIPS_EMSCRIPTEN OR FIPS_PNACL) +if (FIPS_EMSCRIPTEN) add_definitions(-DORYOL_SAMPLE_URL=\"http://localhost/../data/\") # HACK else() add_definitions(-DORYOL_SAMPLE_URL=\"${ORYOL_SAMPLE_URL}\") diff --git a/vagrant/manifests/default.pp b/vagrant/manifests/default.pp index 788a1ca49..33ec495f3 100644 --- a/vagrant/manifests/default.pp +++ b/vagrant/manifests/default.pp @@ -1,6 +1,6 @@ # # Puppet manifest to setup Oryol dev environment -# for compiling to native Linux, emscripten and PNaCl +# for compiling to native Linux and emscripten # # essential packages