Page 1 of 1

2D Texture broken after GLFactory::CreateDevice

Posted: 04 Jan 2022, 15:43
by RevalSoft
Hello!

After creating Renderer of View (via Factory::CreateDevice) some OpenGL state breaks and I'm getting something like this:
Image

But expected:
Image

Any tips, please?

P.S.: Working with the personal engine on C++ which uses while old OpenGL pipeline.

Re: 2D Texture broken after GLFactory::CreateDevice

Posted: 04 Jan 2022, 22:25
by RevalSoft
Resolved.
Problem invokes by uncleared Sampler, fixed via glBindSampler(0, 0) after CreateDevice.

Re: 2D Texture broken after GLFactory::CreateDevice

Posted: 10 Jan 2022, 17:44
by jsantos
Yes, thanks for sharing your solution. Effectively, GLFactory::CreateDevice modifies the current context and you should restore it. We could save and restore the state internally but that would be less efficient. Source code of the renderer is available so it is easy to see the state changes that happen.