Drawing Text

BlitzMax Modules Forums/MiniB3D/Drawing Text

Help!

I'm in complete duffer mode today, because I can't seem to get text display.

I'm creating and entities and then rendering the world. After which I'm running a drawtext command. Either the text is not display aor the rendered image flickers.

I'm using tried standard graphic driver and also set to GLMax2Driver just incase.

Does anybody have an idea what i'm doing wrong. I'm new to MiniB3D (More used to Blitz3d) so it most likely something i'm doing wrong.

Please help me.
Thanks

TobyTyke, you have to make some adjustmentes to the minib3d mod if you want to use max2D. Search the forum or take a look in the following topics:
http://blitzmax.com/Community/posts.php?topic=67884
http://www.blitzbasic.com/Community/posts.php?topic=68167
http://www.blitzbasic.com/Community/posts.php?topic=68250

Thanks Ksalomao, I've tried to implement so these ideas. in a simple test program and I either get nothing, or a large box.

Is this something wrong with my set up.

I'm currently using v.40 of minib3d, i've tried v.41 (Klepto's version) but I won't compile the module on my system. It reports a commandline line error. So I tried to re-install everything from scratch and i'm still gettting the same issue.

All I want to do is display text on the screen after i've rendered the 3d.

All help would be great.

TobyTyke, have you changed the RenderWorld() function in TGlobal.bmx?
Take a look in this replacement that Klepto2 posted in http://www.blitzbasic.com/Community/posts.php?topic=66843 :

Global ortho_mv![16],ortho_pj![16]

Function RenderWorld()
		glDisable(GL_TEXTURE_2D)
		glMatrixMode GL_PROJECTION
		glLoadMatrixd TGLobal.ortho_pj
		glMatrixMode GL_MODELVIEW
		glLoadMatrixd TGLobal.ortho_mv
			
		TGLobal.EnableStates()	
			
		glPopAttrib
		
		SetBlend SolidBlend
		
		
		For Local cam:TCamera=EachIn TCamera.cam_list

			If cam.EntityHidden()=True Then Continue

			RenderCamera(cam)
			
		Next
		
		Local x,y,w,h
		GetViewport(x,y,w,h)
		
		glDisable(GL_LIGHTING)
		glDisable(GL_DEPTH_TEST)
		glDisable(GL_SCISSOR_TEST)
		glDisable(GL_FOG)
		glDisable(GL_CULL_FACE)

		glMatrixMode GL_TEXTURE
		glLoadIdentity
		
		glMatrixMode GL_PROJECTION
		glLoadIdentity
		glOrtho 0,GraphicsWidth(),GraphicsHeight(),0,-1,1
		
		glMatrixMode GL_MODELVIEW
		glLoadIdentity
		
		SetViewport x,y,w,h
		
		Local MaxTex:Int 
		glGetIntegerv(GL_MAX_TEXTURE_UNITS, Varptr(MaxTex))

		
		For Local Layer = 0 Until MaxTex
			glActiveTexture(GL_TEXTURE0+Layer)
				
			glDisable(GL_TEXTURE_CUBE_MAP)
			glDisable(GL_TEXTURE_GEN_S)
			glDisable(GL_TEXTURE_GEN_T)
			glDisable(GL_TEXTURE_GEN_R)

			glDisable(GL_TEXTURE_2D)
		Next
		
		glActiveTexture(GL_TEXTURE0)
		
		DrawRect -10,-10,5,5
		
End Function



Also you should use "setblend ALPHABEND" before your 2D stuff.
I have encontered another strange issue that was solved only when I added a skybox. The 2D stuff appeared very strangely when there was only the black background and nothing to render. Don't know why. Try adding some stuff to your test code and see what happens.

Thanks Ksalomao, I'll take a look and hopefully i'll get it sorted. I'm pretty sure it's something i'm missing.

It is saver to take the miniB3D itself Text Function for displaying plain text. I'm currently sorting out why there are some problems with DrawText.

Use 'Text 0,0,"Hello World" ' Right after Renderworld but before Flip.