Hi,
I use this code to create a GLFW transparency application, and that work fine !
// g++ -o glfw_transparent glfw_transparent.cpp -lglfw -lGL
#include <GLFW/glfw3.h>
//========================================================================
int main( ){
GLFWwindow* window;
int windowSizeW = 640, windowSizeH = 480;
// initialize the library
if (!glfwInit())
return -1;
glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
// create a windowed mode window and its OpenGL context
window = glfwCreateWindow(windowSizeW, windowSizeH, "Hello World", NULL, NULL);
if (!window)
{
glfwTerminate();
return -1;
}
// make the window's context current
glfwMakeContextCurrent(window);
// reset the window hints to default
glfwDefaultWindowHints();
// show the window
glfwShowWindow(window);
// Loop until the user closes the window
while (!glfwWindowShouldClose(window))
{
// render
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_QUADS);
glColor3f(0, 0, 1);
glVertex3f(-0.5, -0.5, -1);
glColor3f(0, 1, 0);
glVertex3f(0.5, -0.5, -1);
glColor3f(1, 0, 1);
glVertex3f(0.5, 0.5, -1);
glColor3f(1, 1, 0);
glVertex3f(-0.5, 0.5, -1);
glEnd();
// swap front and back buffers
glfwSwapBuffers(window);
// poll for and process events
glfwPollEvents();
}
glfwTerminate();
return 0;
}
But i can implement it for ofApp with ofAppGLFWWindow
i try to add in ofAppGLFWWindow.cpp to force it … but nothing
line 170 : glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
and try this code for add settings but not working
int main( ){
ofSetLogLevel(OF_LOG_VERBOSE);
if(!glfwInit( )){
ofLogError("ofAppGLFWWindow") << "couldn't init GLFW";
return 0;
}
glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
ofGLFWWindowSettings settings;
settings.setGLVersion(3,2);
settings.decorated = false;
settings.setSize(600, 600);
settings.windowMode = OF_WINDOW;
settings.doubleBuffering = true;
settings.resizable = false;
settings.visible = true;
ofCreateWindow(settings);
ofRunApp( new ofApp() );
}
Plz help me, thx