PDA

View Full Version : Coping with the blank screen of death.



sol
06-17-2007, 01:17 PM
[INFO] trace.call: glGetString(GL_VERSION) = "1.4 (1.5 Mesa 6.5.2)"
[INFO] trace.call: glGetString(GL_VENDOR) = "Mesa project: www.mesa3d.org"
[INFO] trace.call: glGetString(GL_RENDERER) = "Mesa GLX Indirect"
[INFO] trace.call: glGetString(GL_VERSION) = "1.4 (1.5 Mesa 6.5.2)"
[INFO] trace.call: glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)
[INFO] trace.call: glHint(GL_LINE_SMOOTH_HINT, GL_FASTEST)
[INFO] trace.call: glHint(GL_POINT_SMOOTH_HINT, GL_FASTEST)
[INFO] trace.call: glHint(GL_POLYGON_SMOOTH_HINT, GL_FASTEST)
[INFO] trace.call: glViewport(0, 0, 320, 240)
[INFO] trace.call: glMatrixMode(GL_PROJECTION)
[INFO] trace.call: glLoadIdentity()
[INFO] trace.call: glOrtho(0, 320, 240, 0, -1, 1)
[INFO] trace.call: glMatrixMode(GL_MODELVIEW)
[INFO] trace.call: glLoadIdentity()
[INFO] trace.call: glLoadIdentity()
[INFO] trace.call: glClearColor(0, 0, 0, 1)
[INFO] trace.call: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
[INFO] trace.call: glClearDepth(1)
[INFO] trace.call: glColor3f(1, 1, 1)
[INFO] trace.call: glTranslatef(0, 0, -0.5)
[INFO] trace.call: glBegin(GL_LINES)
[INFO] trace.call: glVertex2f(0, 0)
[INFO] trace.call: glVertex2f(320, 240)
[INFO] trace.call: glEnd()
http://img390.imageshack.us/img390/8456/screen201254ui1.png




[INFO] trace.call: glGetString(GL_VERSION) = "1.4 (1.5 Mesa 6.5.2)"
[INFO] trace.call: glGetString(GL_VENDOR) = "Mesa project: www.mesa3d.org"
[INFO] trace.call: glGetString(GL_RENDERER) = "Mesa GLX Indirect"
[INFO] trace.call: glGetString(GL_VERSION) = "1.4 (1.5 Mesa 6.5.2)"
[INFO] trace.call: glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)
[INFO] trace.call: glHint(GL_LINE_SMOOTH_HINT, GL_FASTEST)
[INFO] trace.call: glHint(GL_POINT_SMOOTH_HINT, GL_FASTEST)
[INFO] trace.call: glHint(GL_POLYGON_SMOOTH_HINT, GL_FASTEST)
[INFO] trace.call: glEnable(GL_TEXTURE_2D)
[INFO] trace.call: glEnable(GL_BLEND)
[INFO] trace.call: glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
[INFO] trace.call: glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
[INFO] trace.call: glPixelStorei(GL_PACK_ALIGNMENT, 1)
[INFO] trace.call: glGenTextures(1, 0x8058db4 -> { 1 })
[INFO] trace.call: glBindTexture(GL_TEXTURE_2D, 1)
[INFO] trace.call: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
[INFO] trace.call: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
[INFO] trace.call: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 32, 32, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0x813f000 -> { })
[INFO] trace.call: glGetError() = GL_NO_ERROR
[INFO] trace.call: glViewport(0, 0, 320, 240)
[INFO] trace.call: glMatrixMode(GL_PROJECTION)
[INFO] trace.call: glLoadIdentity()
[INFO] trace.call: glOrtho(0, 320, 240, 0, -1, 1)
[INFO] trace.call: glMatrixMode(GL_MODELVIEW)
[INFO] trace.call: glLoadIdentity()
[INFO] trace.call: glLoadIdentity()
[INFO] trace.call: glClearColor(0, 0, 0, 1)
[INFO] trace.call: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
[INFO] trace.call: glClearDepth(1)
[INFO] trace.call: glColor3f(1, 1, 1)
[INFO] trace.call: glTranslatef(0, 0, -0.5)
[INFO] trace.call: glBegin(GL_LINES)
[INFO] trace.call: glVertex2f(0, 0)
[INFO] trace.call: glVertex2f(320, 240)
[INFO] trace.call: glEnd()
http://img390.imageshack.us/img390/320/screen201212yb5.png


Apparently there are no stupid questions, just stupid people.

memfr0b
06-18-2007, 08:20 AM
You did not provide texture coordinates for your vertices. That means, both vertices will use whatever tex coord was set before (probably the default (0,0,0,1)), which will map to the texelat index 0 in your buffer (as passed to glTexImage2D). You also didn't specify a texture environment mode, so the texture unit will combine your vertex color with the texture color value using the GL_MODULATE function.

If this texel is black or fully transparent, that would result in what you see in your second screenshot. But without knowing the contents of your texture, i can only guess here.

dorbie
06-26-2007, 12:48 AM
memfr0b, you nailed it, there are no texture coordinates and therefore the same coordinate will be used for the entire line, probably 0,0 (or whatever was last sent to that context but I doubt anything was sent). I bet the 0,0 corner of your texture is black.