Page 1 of 1

OPENGL and DIRECTX problems

Posted: Fri Aug 16, 2013 1:37 pm
by marc_256
Hello,

For testing my 'Industrial 3D Viewer', I made some examples,

OS = WIN 8 - x64
PB = v5.20 - bx...b10

I lost more than a week of debugging, and I found the OPENGL problem:

Conclution: this are still my problems:
- Developed mesh in Blender 2.68 and is OK.
- Converted with my PB written convertion program to PB Mesh data.
!! after testing more than once, there are no problems with my mesh data. !!

1/ if I use 'OPENGL' in the 'Library Subsystem' in the 'Compiler Options'
- the entity is deformed and showes errors (see program 1)
- but I see my test - textinfo 'DrawText()' on the screen

2/ if I use '' in the 'Library Subsystem' in the 'Compiler Options'
- the entity is showed without errors (see program 2)
- but ERROR 'the specified output is NULL (0 value)' and I have to commented my DrawText() lines.
- so I do NOT see my test - textinfo 'DrawText()' on the screen

3/ if I use 'DirectX11' in the 'Library Subsystem' in the 'Compiler Options'
- i get an error 'the 3D Engine can't be initialized'

Code: Select all

;------------------------------------------------------------
;
; PureBasic - Manual Mesh
;
; (c) 2003 - Fantaisie Software
;
;------------------------------------------------------------

#CameraSpeed = 5

Define.f KeyX, KeyY, KeyZ, MouseX, MouseY
Define.f Cam_PosX, Cam_PosY, Cam_PosZ
Define.f x, y, z, nx, ny, nz, u, v
Define.l Co
Define.w t1, t2, t3

Cam_PosX = 0
Cam_PosY = 2000
Cam_PosZ = 3000

	If InitEngine3D()

		InitSprite()
		InitKeyboard()
		InitMouse()

		If OpenWindow(0, 100, 10, 1000, 800, "")
			OpenWindowedScreen(WindowID(0), 0, 0, 1000, 800, 0, 0, 0)

;				EnableWorldPhysics(1)
;				EnableWorldCollisions(1)

; Create a mesh
				CreateMesh(0, #PB_Mesh_TriangleList)

; Read Vertices Base
					Restore pvg_Mesh_Vertices_Data_m:
						For i = 0 To 96-1
							Read.f x
							Read.f y
							Read.f z

							Read.f nx
							Read.f ny
							Read.f nz

;							Read.l Co

;							Read.f u
;							Read.f v

							MeshVertexPosition(x, y, z)
							MeshVertexNormal(nx, ny, nz)
;							MeshVertexColor(Co)
;							MeshVertexTextureCoordinate(u, v)
				Next

; Read Faces
				Restore pvg_Mesh_Faces_Data_m

					For i = 0 To 64-1
						Read.w t1
						Read.w t2
						Read.w t3

						MeshFace(t1, t2, t3)
					Next

; Side
;    For k=0 To 3
;
;      AddSubMesh(#PB_Mesh_TriangleList)
;      For i = 0 To 2
;        Read.f x : Read.f y : Read.f z
;        Read.l Co
;        Read.f u : Read.f v
;       MeshVertexPosition(x, y, z)
;       MeshVertexNormal(0, 0, 0) 
;        MeshVertexColor(Co)
;        MeshVertexTextureCoordinate(u, v)
;      Next i
;      Read.w t1 : Read.w t2 : Read.w t3
;      MeshFace(t1, t2, t3)
;
;    Next


				FinishMesh(#True)
;				NormalizeMesh(0)

;				UpdateMeshBoundingBox(0)

				CreateTexture(0, 100, 100)
					StartDrawing(TextureOutput(0))
						Box(0, 0, 100, 100, $0000D0)
					StopDrawing()

;				CreateMaterial(0, LoadTexture(0, "Geebee2.bmp"))
				CreateMaterial(0, TextureID(0))
				SetMaterialColor(0, #PB_Material_AmbientColor, #PB_Material_AmbientColors)

				CreateEntity(0, MeshID(0), MaterialID(0))
;				ScaleEntity(0, 400, 200, 400)

				CreateCamera(0, 0, 0, 100, 100)

				MoveCamera(0,Cam_PosX, Cam_PosY, Cam_PosZ, #PB_Absolute)
;				MoveCamera(0, 0, 5000, 5000, #PB_Absolute)
				CameraLookAt(0, 0, 0, 0)

				CreateLight(0, RGB(255,255,255), 300, 600, -100)
				AmbientColor(RGB(80, 80, 80))

	Repeat

		If ExamineMouse()
			MouseX = -MouseDeltaX() * #CameraSpeed * 0.05
			MouseY = -MouseDeltaY() * #CameraSpeed * 0.05
		EndIf

	If ExamineKeyboard()

		If KeyboardPushed(#PB_Key_Left)
;			KeyX = -10	;#CameraSpeed
			Cam_PosX = Cam_PosX - 10
		ElseIf KeyboardPushed(#PB_Key_Right)
;			KeyX = 10		;#CameraSpeed
			Cam_PosX = Cam_PosX + 10
;		Else
;			KeyX = 0
		EndIf

		If KeyboardPushed(#PB_Key_Up)
;			KeyY = -10		;-#CameraSpeed
			Cam_PosZ = Cam_PosZ - 10
		ElseIf KeyboardPushed(#PB_Key_Down)
;			KeyY = 10		;#CameraSpeed
			Cam_PosZ = Cam_PosZ + 10
;		Else
;			KeyY = 0
		EndIf

		If KeyboardPushed(#PB_Key_Add)
;			KeyZ = 5
			Cam_PosY = Cam_PosY + 10
		ElseIf KeyboardPushed(#PB_Key_Subtract)
;			KeyZ = -5
			Cam_PosY = Cam_PosY - 10
;		Else
;			KeyZ = 0
		EndIf

			EndIf

;			RotateEntity(0, 1, 1, 1, #PB_Relative)
			RotateCamera(0, MouseY, MouseX, 0, #PB_Relative)
;			MoveCamera(0, KeyX, KeyZ, KeyY)		;, #PB_Absolute)
			MoveCamera(0,Cam_PosX, Cam_PosY, Cam_PosZ, #PB_Absolute)

			RenderWorld()

			StartDrawing(ScreenOutput())
				DrawingMode(#PB_2DDrawing_Transparent)
				DrawText(10, 10, "Cam PosX : " + StrF(KeyX, 3),$F0F0F0)
				DrawText(10, 40, "Cam PosY : " + StrF(KeyY, 3),$F0F0F0)
				DrawText(10, 70, "Cam PosZ : " + StrF(KeyZ, 3),$F0F0F0)
			StopDrawing()

;			Screen3DStats()
			FlipBuffers()

		Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
	EndIf

Else
	MessageRequester("Error", "The 3D Engine can't be initialized", 0)
EndIf

End

DataSection

pvg_Mesh_Vertices_Data_m:

Data.f 1800.000000, 0.000000, 600.000000	; Position xyz
Data.f 0.000000, -1.000000, -0.000000	; Normal xyz
Data.f 1820.000000, 0.000000, 620.000000	; Position xyz
Data.f 0.000000, -1.000000, -0.000000	; Normal xyz
Data.f -1820.000000, 0.000000, 620.000000	; Position xyz
Data.f 0.000000, -1.000000, -0.000000	; Normal xyz
Data.f -600.000000, 200.000000, -600.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f -1800.000000, 0.000000, -600.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f -600.000000, 0.000000, -600.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f -600.000000, 200.000000, -1800.000000	; Position xyz
Data.f 1.000000, -0.000000, -0.000000	; Normal xyz
Data.f -600.000000, 0.000000, -600.000000	; Position xyz
Data.f 1.000000, -0.000000, -0.000000	; Normal xyz
Data.f -600.000000, 0.000000, -1800.000000	; Position xyz
Data.f 1.000000, -0.000000, -0.000000	; Normal xyz
Data.f 600.000000, 200.000000, -1800.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f -600.000000, 0.000000, -1800.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f 600.000000, 0.000000, -1800.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f 600.000000, 200.000000, -600.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f 600.000000, 0.000000, -1800.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f 600.000000, 0.000000, -600.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f 1800.000000, 200.000000, -600.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f 600.000000, 0.000000, -600.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f 1800.000000, 0.000000, -600.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f 1800.000000, 200.000000, 600.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f 1800.000000, 0.000000, -600.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f 1800.000000, 0.000000, 600.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f -1800.000000, 200.000000, 600.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f 1800.000000, 0.000000, 600.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f -1800.000000, 0.000000, 600.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f -1800.000000, 200.000000, -600.000000	; Position xyz
Data.f 1.000000, -0.000000, -0.000000	; Normal xyz
Data.f -1800.000000, 0.000000, 600.000000	; Position xyz
Data.f 1.000000, -0.000000, -0.000000	; Normal xyz
Data.f -1800.000000, 0.000000, -600.000000	; Position xyz
Data.f 1.000000, -0.000000, -0.000000	; Normal xyz
Data.f -1820.000000, 200.000000, -620.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f -620.000000, 0.000000, -620.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f -1820.000000, 0.000000, -620.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f -620.000000, 200.000000, -620.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f -620.000000, 0.000000, -1820.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f -620.000000, 0.000000, -620.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f -620.000000, 200.000000, -1820.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f 620.000000, 0.000000, -1820.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f -620.000000, 0.000000, -1820.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f 620.000000, 200.000000, -1820.000000	; Position xyz
Data.f 1.000000, -0.000000, -0.000000	; Normal xyz
Data.f 620.000000, 0.000000, -620.000000	; Position xyz
Data.f 1.000000, -0.000000, -0.000000	; Normal xyz
Data.f 620.000000, 0.000000, -1820.000000	; Position xyz
Data.f 1.000000, -0.000000, -0.000000	; Normal xyz
Data.f 620.000000, 200.000000, -620.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f 1820.000000, 0.000000, -620.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f 620.000000, 0.000000, -620.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f 1820.000000, 200.000000, -620.000000	; Position xyz
Data.f 1.000000, -0.000000, -0.000000	; Normal xyz
Data.f 1820.000000, 0.000000, 620.000000	; Position xyz
Data.f 1.000000, -0.000000, -0.000000	; Normal xyz
Data.f 1820.000000, 0.000000, -620.000000	; Position xyz
Data.f 1.000000, -0.000000, -0.000000	; Normal xyz
Data.f 1820.000000, 200.000000, 620.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f -1820.000000, 0.000000, 620.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f 1820.000000, 0.000000, 620.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f -1820.000000, 200.000000, 620.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f -1820.000000, 0.000000, -620.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f -1820.000000, 0.000000, 620.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f -1800.000000, 200.000000, 600.000000	; Position xyz
Data.f 0.000000, 1.000000, 0.000000	; Normal xyz
Data.f -1820.000000, 200.000000, 620.000000	; Position xyz
Data.f 0.000000, 1.000000, 0.000000	; Normal xyz
Data.f 1820.000000, 200.000000, 620.000000	; Position xyz
Data.f 0.000000, 1.000000, 0.000000	; Normal xyz
Data.f 1800.000000, 200.000000, 600.000000	; Position xyz
Data.f -0.000000, 1.000000, -0.000000	; Normal xyz
Data.f -1800.000000, 200.000000, -600.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f -600.000000, 200.000000, -600.000000	; Position xyz
Data.f 1.000000, 0.000000, -0.000000	; Normal xyz
Data.f -600.000000, 200.000000, -1800.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f 600.000000, 200.000000, -1800.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f 600.000000, 200.000000, -600.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f 1800.000000, 200.000000, -600.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f 1800.000000, 200.000000, 600.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f -1800.000000, 200.000000, 600.000000	; Position xyz
Data.f 1.000000, 0.000000, -0.000000	; Normal xyz
Data.f -620.000000, 200.000000, -620.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f -620.000000, 200.000000, -1820.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f 620.000000, 200.000000, -1820.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f 620.000000, 200.000000, -620.000000	; Position xyz
Data.f 1.000000, 0.000000, -0.000000	; Normal xyz
Data.f 1820.000000, 200.000000, -620.000000	; Position xyz
Data.f 0.000000, -0.000000, -1.000000	; Normal xyz
Data.f 1820.000000, 200.000000, 620.000000	; Position xyz
Data.f 1.000000, 0.000000, -0.000000	; Normal xyz
Data.f -1820.000000, 200.000000, 620.000000	; Position xyz
Data.f 0.000000, 0.000000, 1.000000	; Normal xyz
Data.f -1820.000000, 200.000000, -620.000000	; Position xyz
Data.f -1.000000, 0.000000, -0.000000	; Normal xyz
Data.f -1820.000000, 200.000000, -620.000000	; Position xyz
Data.f 0.000000, 1.000000, -0.000000	; Normal xyz
Data.f -1800.000000, 200.000000, -600.000000	; Position xyz
Data.f -0.000000, 1.000000, 0.000000	; Normal xyz
Data.f -620.000000, 200.000000, -620.000000	; Position xyz
Data.f 0.000000, 1.000000, -0.000000	; Normal xyz
Data.f -600.000000, 200.000000, -600.000000	; Position xyz
Data.f -0.000000, 1.000000, -0.000000	; Normal xyz
Data.f -620.000000, 200.000000, -1820.000000	; Position xyz
Data.f 0.000000, 1.000000, -0.000000	; Normal xyz
Data.f -600.000000, 200.000000, -1800.000000	; Position xyz
Data.f 0.000000, 1.000000, -0.000000	; Normal xyz
Data.f 620.000000, 200.000000, -1820.000000	; Position xyz
Data.f 0.000000, 1.000000, -0.000000	; Normal xyz
Data.f 600.000000, 200.000000, -1800.000000	; Position xyz
Data.f -0.000000, 1.000000, -0.000000	; Normal xyz
Data.f 620.000000, 200.000000, -620.000000	; Position xyz
Data.f 0.000000, 1.000000, 0.000000	; Normal xyz
Data.f 600.000000, 200.000000, -600.000000	; Position xyz
Data.f 0.000000, 1.000000, -0.000000	; Normal xyz
Data.f 1800.000000, 200.000000, -600.000000	; Position xyz
Data.f 0.000000, 1.000000, 0.000000	; Normal xyz
Data.f 1820.000000, 200.000000, -620.000000	; Position xyz
Data.f 0.000000, 1.000000, -0.000000	; Normal xyz
Data.f -620.000000, 0.000000, -620.000000	; Position xyz
Data.f -0.000000, -1.000000, 0.000000	; Normal xyz
Data.f -620.000000, 0.000000, -1820.000000	; Position xyz
Data.f -0.000000, -1.000000, 0.000000	; Normal xyz
Data.f -600.000000, 0.000000, -1800.000000	; Position xyz
Data.f -0.000000, -1.000000, 0.000000	; Normal xyz
Data.f -600.000000, 0.000000, -600.000000	; Position xyz
Data.f -0.000000, -1.000000, -0.000000	; Normal xyz
Data.f -1800.000000, 0.000000, -600.000000	; Position xyz
Data.f 0.000000, -1.000000, -0.000000	; Normal xyz
Data.f 1820.000000, 0.000000, -620.000000	; Position xyz
Data.f 0.000000, -1.000000, 0.000000	; Normal xyz
Data.f 1800.000000, 0.000000, -600.000000	; Position xyz
Data.f -0.000000, -1.000000, -0.000000	; Normal xyz
Data.f 620.000000, 0.000000, -620.000000	; Position xyz
Data.f 0.000000, -1.000000, -0.000000	; Normal xyz
Data.f 600.000000, 0.000000, -600.000000	; Position xyz
Data.f -0.000000, -1.000000, -0.000000	; Normal xyz
Data.f 600.000000, 0.000000, -1800.000000	; Position xyz
Data.f 0.000000, -1.000000, -0.000000	; Normal xyz
Data.f 620.000000, 0.000000, -1820.000000	; Position xyz
Data.f 0.000000, -1.000000, -0.000000	; Normal xyz
Data.f -1820.000000, 0.000000, -620.000000	; Position xyz
Data.f -0.000000, -1.000000, 0.000000	; Normal xyz
Data.f -1800.000000, 0.000000, 600.000000	; Position xyz
Data.f -0.000000, -1.000000, -0.000000	; Normal xyz

pvg_Mesh_Faces_Data_m:

Data.w 0, 1, 2	; Face xyz
Data.w 3, 4, 5	; Face xyz
Data.w 6, 7, 8	; Face xyz
Data.w 9, 10, 11	; Face xyz
Data.w 12, 13, 14	; Face xyz
Data.w 15, 16, 17	; Face xyz
Data.w 18, 19, 20	; Face xyz
Data.w 21, 22, 23	; Face xyz
Data.w 24, 25, 26	; Face xyz
Data.w 27, 28, 29	; Face xyz
Data.w 30, 31, 32	; Face xyz
Data.w 33, 34, 35	; Face xyz
Data.w 36, 37, 38	; Face xyz
Data.w 39, 40, 41	; Face xyz
Data.w 42, 43, 44	; Face xyz
Data.w 45, 46, 47	; Face xyz
Data.w 48, 49, 50	; Face xyz
Data.w 51, 52, 53	; Face xyz
Data.w 53, 54, 51	; Face xyz
Data.w 3, 55, 4	; Face xyz
Data.w 6, 56, 7	; Face xyz
Data.w 9, 57, 10	; Face xyz
Data.w 12, 58, 13	; Face xyz
Data.w 15, 59, 16	; Face xyz
Data.w 18, 60, 19	; Face xyz
Data.w 21, 61, 22	; Face xyz
Data.w 24, 62, 25	; Face xyz
Data.w 27, 63, 28	; Face xyz
Data.w 30, 64, 31	; Face xyz
Data.w 33, 65, 34	; Face xyz
Data.w 36, 66, 37	; Face xyz
Data.w 39, 67, 40	; Face xyz
Data.w 42, 68, 43	; Face xyz
Data.w 45, 69, 46	; Face xyz
Data.w 48, 70, 49	; Face xyz
Data.w 52, 51, 71	; Face xyz
Data.w 72, 71, 51	; Face xyz
Data.w 71, 72, 73	; Face xyz
Data.w 74, 73, 72	; Face xyz
Data.w 73, 74, 75	; Face xyz
Data.w 75, 74, 76	; Face xyz
Data.w 75, 76, 77	; Face xyz
Data.w 78, 77, 76	; Face xyz
Data.w 77, 78, 79	; Face xyz
Data.w 80, 79, 78	; Face xyz
Data.w 79, 80, 81	; Face xyz
Data.w 81, 54, 53	; Face xyz
Data.w 81, 53, 82	; Face xyz
Data.w 81, 82, 79	; Face xyz
Data.w 83, 84, 85	; Face xyz
Data.w 83, 85, 86	; Face xyz
Data.w 83, 86, 87	; Face xyz
Data.w 1, 0, 88	; Face xyz
Data.w 89, 88, 0	; Face xyz
Data.w 88, 89, 90	; Face xyz
Data.w 91, 90, 89	; Face xyz
Data.w 90, 91, 92	; Face xyz
Data.w 93, 90, 92	; Face xyz
Data.w 93, 92, 85	; Face xyz
Data.w 93, 85, 84	; Face xyz
Data.w 2, 94, 87	; Face xyz
Data.w 2, 87, 95	; Face xyz
Data.w 2, 95, 0	; Face xyz
Data.w 87, 94, 83	; Face xyz

EndDataSection



Can someone help here ?
Or test this program ?

Thanks,
Marc,

Re: OPENGL and DIRECTX problems

Posted: Fri Aug 16, 2013 1:43 pm
by PMV
ScreenOutput() never worked with PB-OGRE, you
have to use a sprite to write your text and display
that sprite.

OGREs DirectX11 Rendersystem is still very buggy,
so Fred has decided to not use it for now ... maybe
with OGRE 1.9.0, but thats not final yet ... so only
DirectX9 is still possible with OGRE.

MFG PMV

Re: OPENGL and DIRECTX problems

Posted: Fri Aug 16, 2013 1:49 pm
by marc_256
Hi PMV,
ScreenOutput() never worked with PB-OGRE,
With 'OPENGL' it works very well,
But then my mesh is very bugged...

Marc,

Re: OPENGL and DIRECTX problems

Posted: Fri Aug 16, 2013 2:00 pm
by PMV
Sorry, haven't used OpenGL on windows that much,
and your code always crashes with OpenGL after a
few seconds ... so there seems to be something else
buggy, too. I just wanted to tell you what i know
about DX (sub)systems. :D

FMG PMV

Re: OPENGL and DIRECTX problems

Posted: Fri Aug 16, 2013 2:03 pm
by marc_256
Thanks for the info,

marc,

Re: OPENGL and DIRECTX problems

Posted: Fri Aug 16, 2013 2:44 pm
by LuCiFeR[SD]
I don't really know enough about 3D to be of much help with the 3D side.... but I can confirm your problems with OpenGL behaving a little oddly :)

ScreenOutput is bad as it just wont work on all subsystems. you definitely need to use SpriteOutput() instead.
something along the lines of.....

Code: Select all

   TextSprite=CreateSprite(#PB_Any,150,150)
    Repeat

Code: Select all

RenderWorld()
      
      StartDrawing(SpriteOutput(TextSprite))
      DrawingMode(#PB_2DDrawing_Transparent)
      Box(0,0,SpriteWidth(TextSprite),SpriteHeight(TextSprite),$000000)
      DrawText(10, 10, "Cam PosX : " + StrF(KeyX, 3),$F0F0F0)
      DrawText(10, 40, "Cam PosY : " + StrF(KeyY, 3),$F0F0F0)
      DrawText(10, 70, "Cam PosZ : " + StrF(KeyZ, 3),$F0F0F0)
      StopDrawing()
      DisplayTransparentSprite(TextSprite,0,0)
      ;         Screen3DStats()

Re: OPENGL and DIRECTX problems

Posted: Fri Aug 16, 2013 9:18 pm
by marc_256
Hi LuCiFeR[SD],

your work around works fine,
but the quality of the text is not the same as in OPENGL

you can see the result here,
http://www.purebasic.fr/english/viewtop ... 27&t=56030

thanks,
marc,

Re: OPENGL and DIRECTX problems

Posted: Fri Aug 16, 2013 9:40 pm
by LuCiFeR[SD]
marc_256 wrote:Hi LuCiFeR[SD],

your work around works fine,
but the quality of the text is not the same as in OPENGL

you can see the result here,
http://www.purebasic.fr/english/viewtop ... 27&t=56030

thanks,
marc,
That is a really nice program Marc! maybe worth using a larger/different font to try and improve the quality. although to be honest.... I didn't notice a difference on my system between dx/ogl Possibly anti-aliasing or something. I'll take another look though :)

Re: OPENGL and DIRECTX problems

Posted: Fri Aug 16, 2013 10:13 pm
by PMV
marc_256 wrote:Hi LuCiFeR[SD],

your work around works fine,
but the quality of the text is not the same as in OPENGL

you can see the result here,
http://www.purebasic.fr/english/viewtop ... 27&t=56030

thanks,
marc,
This is not his work around, it is how it should be done
with DX as i told you before :wink:
For the problem with AA ... PB just uses GDI, but you
have to use GDI+ for that, so this is your thread to go:
http://www.purebasic.fr/english/viewtop ... 12&t=46987

MFG PMV

Re: OPENGL and DIRECTX problems

Posted: Fri Aug 16, 2013 10:43 pm
by marc_256
Yes, I tried a bigger and different font, with the same results,


@ PMV

You are write, but I wanted to use OPENGL for my project,
and there the text is perfect on the screen.

But then my mesh/entity is buggy, and is deformed.
This must be a OGL problem.

Marc,