-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FrameBuffer::clearColor not working #16
Comments
Hi, thanks for the detailed report! Hmm. Actually I think I know what's happening here --
Setting the clear color (without clearing anything) is done using GL::Renderer::setClearColor() instead, so to fix the above either:
What might be helpful for you -- the documentation has a table mapping from GL APIs to Magnum APIs, so if you know what you want to do in raw GL, you can use the table to see the equivalent Magnum APIs. It's also possible to use the search to search for e.g. glClearColor and it'll show what function it corresponds to. Every function documentation also lists GL APIs used underneath. Hope this helps! :) Originally I thought you're hitting a driver bug because very recently I was pushing some workarounds for Intel drivers on Windows where using |
Thanks a lot for the fast and detailed explanation. I was confused because I misinterpreted the documentation of GL::Renderer::setClearColor but now it is "clear" to me. Now, I just tried both approaches:
This one worked as spected cleaning the buffer with red color.
Unfortunately this one didn't work, leaving the frame buffer with a gray-black color instead of green. Is GL_COLOR_ATTACHMENT0 the right attachment to clear? This is the startup info: Renderer: GeForce GTX 1050/PCIe/SSE2 by NVIDIA Corporation |
Haha, right, the Try this instead: qtDefaultFramebuffer.clearColor(0, Color4::green()); Also, the code you have above should throw some GL error. You can either check GL errors manually (which is tedious), or you can run the app with In general, none of the Magnum APIs expect raw GL enums, it's always either a numeric value or a C++11 scoped enum wrapping the raw GL values in a more typesafe way. |
Alright that was it :). I added the command in the build configuration and the console was displaying some clear errors. Thanks for the tips, I'll take them in consideration. |
Great :) Anything else or can this be closed as resolved? :) For general questions you can join the Gitter channel (simply log in with your GitHub account), usually there's always someone around who's happy to help. |
Yes, that's all. |
I've succesfully installed the base-qt bootstrap, however, I have a little problem using the function clearColor which in fact doesn't change the clear color from the default buffer.
with the given paintGL function:
I added the clearColor call before clearing the buffer, but it doesn't work. So i tried using the native opengl function which actually worked as spected. I'm not sure if i'm doing something wrong or it's a bug.
OS: Windows 10
IDE: Visual Studio 2017
Qt: 5.12
Both Magnum and Corrade where compiled from master branch.
The text was updated successfully, but these errors were encountered: