Home » U++ Library support » U++ Library : Other (not classified elsewhere) » [Proposal] GLCtrl and textures (Not sure where to make a call to pre-generate a texture)
[Proposal] GLCtrl and textures [message #56489] |
Thu, 18 March 2021 20:41  |
jjacksonRIAB
Messages: 227 Registered: June 2011
|
Experienced Member |
|
|
I get the dreaded white texture of death rendering a quad and I discovered the only place I can get it to work is in GLPaint, but that kind of defies the purpose of creating a texture beforehand and binding it. I looked through the source for GLCtrl and could find no obvious hook for getting calls in right after a gl initialization call so I added a callback WhenGLInit and call it here:
void GLCtrl::ExecuteGL(Event<> paint, bool swap_buffers)
{
MemoryIgnoreLeaksBlock __;
glXMakeCurrent(s_Display, win, s_GLXContext);
ONCELOCK {
glewInit();
WhenGLInit();
}
paint();
if(swap_buffers)
glXSwapBuffers(s_Display, win);
else
glFlush();
glXMakeCurrent(s_Display, None, NULL);
}
Textures work fine after that. Is there some other hook that I can make calls right after GL has been initialized/context has been created and I simply missed it? Is there a more appropriate way to do this?
[Updated on: Thu, 18 March 2021 21:17] Report message to a moderator
|
|
|
|
|
Re: GLCtrl and textures [message #56503 is a reply to message #56499] |
Fri, 19 March 2021 16:38  |
jjacksonRIAB
Messages: 227 Registered: June 2011
|
Experienced Member |
|
|
Hmm, I already tried putting my call at the end of CreateContext and I got white textures of death. I'll follow execution and see if I'm getting a double-initialization somewhere. Thanks, Mirek.
|
|
|
Goto Forum:
Current Time: Sat Apr 26 15:00:56 CEST 2025
Total time taken to generate the page: 0.02061 seconds
|