
OGRE doesn't work
OGRE doesn't work
I tried to get the OGRe examples to run but it seems the Load functions are broken. LoadTexture and LoadMesh don't work but the paths are correct
For example LoadTexture in combination with CreateMaterial gives me the error: The specified TextureID is null.

Well, nothing easier than that. Just take any of the 3D examples that come with PB 4.02, like:
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - Texture
;
; (c) 2003 - Fantaisie Software
;
; ------------------------------------------------------------
;
#CameraSpeed = 10
IncludeFile "Screen3DRequester.pb"
Define.f KeyX, KeyY, MouseX, MouseY
If InitEngine3D()
Add3DArchive("Data\", #PB_3DArchive_FileSystem)
InitSprite()
InitKeyboard()
InitMouse()
If Screen3DRequester()
LoadSprite(0, "Data\Background.bmp")
AmbientColor(RGB(255,255,255))
LoadMesh (0, "Robot.mesh")
CreateMaterial(0, LoadTexture(0, "r2skin.jpg"))
CreateMaterial(1, LoadTexture(1, "clouds.jpg"))
MaterialBlendingMode(1, 3) ; Alphablending for this texture
If StartDrawing(TextureOutput(0)) ; Draw a box on our texture..
Box(0,0, 100, 100, RGB(255, 0, 0))
StopDrawing()
EndIf
CreateEntity (0, MeshID(0), MaterialID(1))
CreateEntity (1, MeshID(0), MaterialID(0))
MoveEntity(1, 100, 0, 0)
CreateCamera(0, 0, 0, 100, 100)
CameraLocate(0,0,0,100)
Repeat
Screen3DEvents()
ClearScreen(RGB(0, 0, 0))
DisplaySprite(0, 0, 0)
If ExamineKeyboard()
If KeyboardPushed(#PB_Key_Left)
KeyX = -#CameraSpeed
ElseIf KeyboardPushed(#PB_Key_Right)
KeyX = #CameraSpeed
Else
KeyX = 0
EndIf
If KeyboardPushed(#PB_Key_Up)
KeyY = -#CameraSpeed
ElseIf KeyboardPushed(#PB_Key_Down)
KeyY = #CameraSpeed
Else
KeyY = 0
EndIf
EndIf
If ExamineMouse()
MouseX = -(MouseDeltaX()/10)*#CameraSpeed/2
MouseY = -(MouseDeltaY()/10)*#CameraSpeed/2
EndIf
RotateEntity(0, 1, 0, 0)
RotateEntity(1, 0.5, 0, 0)
RotateCamera(0, MouseX, MouseY, RollZ)
MoveCamera (0, KeyX, 0, KeyY)
RenderWorld()
Screen3DStats()
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
EndIf
Else
MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf
End
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
That means that the specific texture is either missing, damaged or in some inappropriate format.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
The textures are fine. I took a look at them and they are ok. The path is correct as well. There are other examples (sprite) that load from the same directory and have no problems. I also load the sourcefiles directly (not from the helpfiles). So it seems the problem lies within the 3darchive functions of the 3d engine (OGRE).
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Why should he do that? He's just running sourcecode not a complied .EXE. Putting the Engine3D.dll in the sources directory is redundant because it's already in the compiler folder.Brice Manuel wrote:are you making sure you put the engine DLL into the directory of the source file?
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Why shouldn't he? Obviously what he is doing isn't working. When that is the case, you should try everything.Fluid Byte wrote:Why should he do that?
We are dealing with Windows, right? Its not like XP is even compatible with itself. There are all kinds of obscure bugs in Windows that will let something work for most people but not for one person.
Of course one could ask why he is bothering since the 3D support in PB is useless :roll:
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Agreed!We are dealing with Windows, right? Its not like XP is even compatible with itself. There are all kinds of obscure bugs in Windows that will let something work for most people but not for one person.
Not useless, just "special". But oh well, that's another story and not the right place for such a debate.Of course one could ask why he is bothering since the 3D support in PB is useless
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
I already tried to put the engine.dll with the compiled exe in the same folder as the sourccefiles are. But the engine.dll is not the problem. I see the 3d preference option window and then even the 3d mode starts and shows me a white background with a black plane. I can even move the camera with the mouse and all. It's just the mesh and texture loading functions that are not working 

Re: OGRE doesn't work
Sebe wrote:I tried to get the OGRe examples to run but it seems the Load functions are broken. LoadTexture and LoadMesh don't work but the paths are correctFor example LoadTexture in combination with CreateMaterial gives me the error: The specified TextureID is null.
Have you try MeshManual.pb example ? can you see the cube ?
May be you can try MouseOver3D in my signature, i use LoadMesh and LoadTexture and they work fine here with PB4.02
Please correct my english
http://purebasic.developpez.com/
http://purebasic.developpez.com/
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Video Card: ATI Radeon x1600
I have tried all OGRE examples that came with PB 4.02
Will try other examples like the ones of Comtois when I'm at home again (tomorrow).
@Brice Manuel: 3D support in PB is far away from being useless. The features surpass the ones from Blitz3D (physics, stencil shadows). Hopefully OGRE will be updated soon to support DX9 and shaders.
I have tried all OGRE examples that came with PB 4.02

Will try other examples like the ones of Comtois when I'm at home again (tomorrow).
@Brice Manuel: 3D support in PB is far away from being useless. The features surpass the ones from Blitz3D (physics, stencil shadows). Hopefully OGRE will be updated soon to support DX9 and shaders.