From af33e9154e717f42d33ff81f4919cc7ed7bc69c2 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Sun, 8 Dec 2024 01:56:32 -0300 Subject: [PATCH] [test] ofTexture more straightforward way to see if it support GL_RGB16F (#8212) --- .github/workflows/of.yml | 4 +-- libs/openFrameworks/app/ofAppEGLWindow.cpp | 33 +++++++++++----------- libs/openFrameworks/app/ofAppEGLWindow.h | 1 + libs/openFrameworks/gl/ofTexture.h | 13 ++++----- libs/openFrameworks/utils/ofConstants.h | 3 +- scripts/apothecary | 2 +- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/of.yml b/.github/workflows/of.yml index 53b5cb50b70..661de38a49f 100644 --- a/.github/workflows/of.yml +++ b/.github/workflows/of.yml @@ -103,9 +103,9 @@ jobs: - name: Install dependencies run: ./scripts/ci/msys2/install.sh --msystem=${{ matrix.msystem }} - - name: LS + - name: List Directories shell: bash - run: ls -alfR + run: find . -type d - name: Build run: ./scripts/ci/msys2/build.sh diff --git a/libs/openFrameworks/app/ofAppEGLWindow.cpp b/libs/openFrameworks/app/ofAppEGLWindow.cpp index e9a00834cd6..7b4c3709928 100644 --- a/libs/openFrameworks/app/ofAppEGLWindow.cpp +++ b/libs/openFrameworks/app/ofAppEGLWindow.cpp @@ -10,7 +10,6 @@ #include // x11 #include -#include // include includes for both native and X11 possibilities #include @@ -33,7 +32,7 @@ struct udev* udev; struct udev_monitor* mon; static int udev_fd = -1; -typedef map device; +typedef std::map device; static device inputDevices; // minimal map @@ -76,8 +75,8 @@ typedef struct { int mouseButtonState; } MouseState; -typedef map TouchState; -typedef map TouchPosition; +typedef std::map TouchState; +typedef std::map TouchPosition; // TODO, make this match the upcoming additions to ofWindow #define MOUSE_BUTTON_LEFT_MASK 1 @@ -150,7 +149,7 @@ static const struct { #define CASE_STR(x,y) case x: str = y; break static const char* eglErrorString(EGLint err) { - string str; + std::string str; switch (err) { CASE_STR(EGL_SUCCESS, "no error"); CASE_STR(EGL_NOT_INITIALIZED, "EGL not, or could not be, initialized"); @@ -412,7 +411,7 @@ void ofAppEGLWindow::setup(const ofAppEGLWindowSettings & _settings) { // pDisplay = ofGetEnv("DISPLAY"); // bool bIsX11Available = (pDisplay != NULL); - bool bIsX11Available = ofGetEnv("DISPLAY") != NULL; + bool bIsX11Available = !empty(ofGetEnv("DISPLAY")); if(settings.eglWindowPreference == OF_APP_WINDOW_AUTO) { if(bIsX11Available) { @@ -899,7 +898,7 @@ ofCoreEvents & ofAppEGLWindow::events(){ } //------------------------------------------------------------ -shared_ptr & ofAppEGLWindow::renderer(){ +std::shared_ptr & ofAppEGLWindow::renderer(){ return currentRenderer; } @@ -1033,7 +1032,7 @@ void ofAppEGLWindow::pollEvents(){ } } } else { - queue mouseEventsCopy; + std::queue mouseEventsCopy; instance->lock(); mouseEventsCopy = instance->mouseEvents; while(!instance->mouseEvents.empty()){ @@ -1046,7 +1045,7 @@ void ofAppEGLWindow::pollEvents(){ } // KEYBOARD EVENTS - queue keyEventsCopy; + std::queue keyEventsCopy; instance->lock(); keyEventsCopy = instance->keyEvents; while(!instance->keyEvents.empty()){ @@ -1058,7 +1057,7 @@ void ofAppEGLWindow::pollEvents(){ keyEventsCopy.pop(); } - queue touchEventsCopy; + std::queue touchEventsCopy; instance->lock(); touchEventsCopy = instance->touchEvents; while(!instance->touchEvents.empty()){ @@ -1083,7 +1082,7 @@ void ofAppEGLWindow::showCursor(){ } //------------------------------------------------------------ -void ofAppEGLWindow::setWindowTitle(string title) { +void ofAppEGLWindow::setWindowTitle(std::string title) { ofLogNotice("ofAppEGLWindow") << "setWindowTitle(): not implemented"; } @@ -1528,7 +1527,7 @@ void ofAppEGLWindow::processInput(int fd, const char * node){ while(nBytesRead >= 0){ if(ev.type == EV_KEY){ if(ev.code == BTN_LEFT){ - ofLogNotice("ofAppEGLWindow") << "BTN_LEFT" << endl; + ofLogNotice("ofAppEGLWindow") << "BTN_LEFT" << std::endl; if(ev.value == 0){ // release mouseEvent.button = OF_MOUSE_BUTTON_LEFT; mouseEvent.type = ofMouseEventArgs::Released; @@ -1541,7 +1540,7 @@ void ofAppEGLWindow::processInput(int fd, const char * node){ pushMouseEvent = true; } }else if(ev.code == BTN_MIDDLE){ - ofLogNotice("ofAppEGLWindow") << "BTN_MIDDLE" << endl; + ofLogNotice("ofAppEGLWindow") << "BTN_MIDDLE" << std::endl; if(ev.value == 0){ // release mouseEvent.button = OF_MOUSE_BUTTON_MIDDLE; mouseEvent.type = ofMouseEventArgs::Released; @@ -1554,7 +1553,7 @@ void ofAppEGLWindow::processInput(int fd, const char * node){ pushMouseEvent = true; } }else if(ev.code == BTN_RIGHT){ - ofLogNotice("ofAppEGLWindow") << "BTN_RIGHT" << endl; + ofLogNotice("ofAppEGLWindow") << "BTN_RIGHT" << std::endl; if(ev.value == 0){ // release mouseEvent.button = OF_MOUSE_BUTTON_RIGHT; mouseEvent.type = ofMouseEventArgs::Released; @@ -1749,7 +1748,7 @@ void ofAppEGLWindow::processInput(int fd, const char * node){ axisValuePending = true; break; default: - ofLogNotice("ofAppEGLWindow") << "readMouseEvents(): unknown mouse axis (perhaps it's the scroll wheel?): axis " << axis << " amount " << amount << endl; + ofLogNotice("ofAppEGLWindow") << "readMouseEvents(): unknown mouse axis (perhaps it's the scroll wheel?): axis " << axis << " amount " << amount << std::endl; break; } }else if (ev.type == EV_ABS){ @@ -1807,7 +1806,7 @@ void ofAppEGLWindow::processInput(int fd, const char * node){ touchAxisValuePending = true; break; default: - ofLogNotice("ofAppEGLWindow") << "EV_ABS unknown axis: axis " << axis << " amount " << amount << endl; + ofLogNotice("ofAppEGLWindow") << "EV_ABS unknown axis: axis " << axis << " amount " << amount << std::endl; break; } }else if(ev.type == EV_MSC){ @@ -2265,7 +2264,7 @@ void ofAppEGLWindow::handleX11Event(const XEvent& event){ instance->coreEvents.notifyMouseEvent(mouseEvent); break; case MotionNotify: - //cout << "motion notify" << endl; + //cout << "motion notify" << std::endl; mouseEvent.x = static_cast(event.xmotion.x); mouseEvent.y = static_cast(event.xmotion.y); mouseEvent.button = event.xbutton.button; diff --git a/libs/openFrameworks/app/ofAppEGLWindow.h b/libs/openFrameworks/app/ofAppEGLWindow.h index 7ea433c6905..a70a35e2aff 100644 --- a/libs/openFrameworks/app/ofAppEGLWindow.h +++ b/libs/openFrameworks/app/ofAppEGLWindow.h @@ -11,6 +11,7 @@ #include #include #include +#include enum ofAppEGLWindowType { OF_APP_WINDOW_AUTO, diff --git a/libs/openFrameworks/gl/ofTexture.h b/libs/openFrameworks/gl/ofTexture.h index 5c32d964694..442bf31ff37 100644 --- a/libs/openFrameworks/gl/ofTexture.h +++ b/libs/openFrameworks/gl/ofTexture.h @@ -177,13 +177,12 @@ class ofTextureData { glInternalFormat = GL_RGB8; textureTarget = GL_TEXTURE_RECTANGLE_ARB; #elif defined(TARGET_OPENGLES) - if(ofGLESVersionFromGL() >= 300) { - glInternalFormat = GL_RGB16F; - textureTarget = GL_TEXTURE_2D; - } else { - glInternalFormat = GL_RGB; - textureTarget = GL_TEXTURE_2D; - } + #if defined(GL_RGB16F) + glInternalFormat = GL_RGB16F; + #else + glInternalFormat = GL_RGB; + #endif + textureTarget = GL_TEXTURE_2D; #endif tex_t = 0; diff --git a/libs/openFrameworks/utils/ofConstants.h b/libs/openFrameworks/utils/ofConstants.h index 5b7a8e142e2..bc9f138974e 100644 --- a/libs/openFrameworks/utils/ofConstants.h +++ b/libs/openFrameworks/utils/ofConstants.h @@ -128,7 +128,8 @@ enum ofTargetPlatform{ #elif defined (__ANDROID__) #define TARGET_ANDROID #define TARGET_OPENGLES -#elif defined(__ARMEL__) +//#elif defined(__ARMEL__) +#elif defined(__ARM__) #define TARGET_LINUX #define TARGET_OPENGLES #define TARGET_LINUX_ARM diff --git a/scripts/apothecary b/scripts/apothecary index 3e5d43b1ae5..313b213ede6 160000 --- a/scripts/apothecary +++ b/scripts/apothecary @@ -1 +1 @@ -Subproject commit 3e5d43b1ae518270f93dc78546482ecb977eb9bd +Subproject commit 313b213ede658eb6ae3fa5c4fb21a7bdcbe2230a