GLDrawText()
BlitzMax Forums/OpenGL Module/GLDrawText()
| ||
I'm tinkering with GL again, what OpenGL settings might I be messing with that would cause Max2Ds GLDrawText to draw a black rectangle? |
| ||
try disabling textures, took me a while to figure out!! |
| ||
and if you call glBindTexture restore it afterwards |
| ||
im having the same prob tom :P I dont suppose anyone could provide a little example of what they mean? |
| ||
I usually do all my drawtext's at the end of my loop after I've drawn everthing with a texture... glDisable(GL_TEXTURE_2D) gldrawtext "hello world",20,20 glEnable(GL_TEXTURE_2D) rem from this point on no texture is bound |
| ||
Hi, GLDrawText should save/restore any state changes it makes - ie: you shouldn't have to worry about current state etc before using it. However, there are a lot of states that can affect it and we've probably missed some. Could you please post some code that produces the black rectangle problem? |
| ||
Mark, I am using terrabits engine and started modifying it so its basically the same one. Most of the changes ive made so far are just getting rid of flushmem and the bglcreatecontext command. |
| ||
Partialy fixed, text is white now but it's drawn on a black rectange still. I suspect it's an alpha thing somewhere. This got my text back to white anyway glActiveTextureARB(GL_TEXTURE0_ARB) glClientActiveTextureARB(GL_TEXTURE0_ARB) The code's pretty complex & messy, involves a fair bit of multitexturing and uses a lot of gl commands. I'll see if I can make a smaller example. |
| ||
Ok, bit easier than I thought :)GLGraphics 800,600,0,0, GL_BACKBUFFER | GL_DEPTHBUFFER glClearColor(0.5, 0.5, 0.5, 0.0) While Not KeyHit(KEY_ESCAPE) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) GLDrawText "BRL Rock",400,300 Flip True Wend |
| ||
lighting effects it too from memory (or used to...) |
| ||
glEnable(GL_BLEND) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) Fixes it, I was disabling GL_BLEND at the end of my drawing routine, oops! |