View Full Version : texture does not work

12-12-2016, 10:32 AM

i was working on an OpenGL Project using glew/glfw/glm. Now i decided to use Qt instead, but i have some problems with the textures when porting the project from glew to Qt.

Here is my old glew code: https://git.rwth-aachen.de/carstenf/OpenGL/tree/master/MshViewer
and here is my new code using Qt: https://git.rwth-aachen.de/carstenf/OpenGL/tree/master/MeshViewerQt

I get this warning/error when i tried to open a msh file.

Cannot resize a texture that already has storage allocated.
To do so, destroy() the texture and then create() and setSize()

the texture is not opened, as well, but as you can see here (https://git.rwth-aachen.de/carstenf/OpenGL/blob/master/MeshViewerQt/Source/MainWindow.cpp#L70) i'm using a stock solid red texture if the file could not be open. So that texture open bug is a different problem.

Pretty sure it's a kind of order problem

12-12-2016, 10:59 AM
Cannot resize a texture that already has storage allocated.

thats true if you use "glTexStorage2D(...)" to allocate memory

once you allocated the memory, you cant re-allocate later
try "glTexImage2D(...)" instead

12-14-2016, 08:21 AM
I used as many Gl functions instead of qt as possible, so i could copy more of my old working code. But there is still nothing displayed. NOTHING!!!
Is there any way to check what data is in my buffer??
code is here: https://git.rwth-aachen.de/carstenf/OpenGL/tree/master/MeshViewerQt