Handmade Hero»Forums»Code
The_8th_mage
69 posts / 1 project
my lines disappear in some ogl thing
hello,
I try to zoom into a bitmap, and it shouldn't be hard, just changing the gl_texcoord input, but when i do it my lines that are created by gl_lines just disappear. they disappear in accordance with my zoom which suggest some alpha thing, but i really don't know. my code is in the pastebin, pls help.
http://pastebin.com/zGBDrWrL
Thanks,
The_8th_mage
Mārtiņš Možeiko
2559 posts / 2 projects
my lines disappear in some ogl thing
Edited by Mārtiņš Možeiko on
I don't see where are you drawing GL_LINES. I see only filled rectangle with solid color by drawing two triangles. And a sprite by drawing two triangles. Where are the lines?

Are you saying that if you comment out call to render_rectangle_bitmap function, then your lines are drawn incorrectly? That seems very unlikely. There should be error somewhere else in your code, not the part you are showing in pastebin.

Have you verified glGetError() doesn't produce error? If it does, then call it after every single GL call to find which one fails. Or if you are using modern GL context, try using GL_ARB_debug_output extension if your driver/GPU supports it.
Mārtiņš Možeiko
2559 posts / 2 projects
my lines disappear in some ogl thing
We solved this on IRC chat.

Code pasted here was not very accurate to what really was used in real code.

In real code the glBindTexture(GL_TEXTURE_2D, 0) was not called before using glBegin(GL_LINE_LOOP). And line loop was not using any texture coordinates. That means nothing reasonable was rendered if texture was bound before this glBegin.