InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Just starting out? Need help? Post your questions and find answers here.
endo
Enthusiast
Enthusiast
Posts: 141
Joined: Fri Apr 30, 2004 10:44 pm
Location: Turkiye (istanbul)
Contact:

InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by endo »

InitEngine3D doesn't fail and the code runs, but the compiled executable doesn't work correctly on Asus eeePC (1024x600x32) WinXP/Home.
Screen open but no refresh or drawing appears on the screen (sometimes black screen, sometimes I see my desktop image)

Code: Select all

If InitEngine3D() = 0: End: EndIf ;when I remove this line it works as expected
If InitSprite() = 0: End: EndIf
If InitKeyboard() = 0: End: EndIf	
If OpenScreen(1024,600,32,"") = 0: End: EndIf
Repeat
	ClearScreen(RGB(Random(255),Random(255),Random(255)))
	FlipBuffers(): ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
-= endo (registered user of purebasic since 98) =-
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by Samuel »

endo wrote:InitEngine3D doesn't fail and the code runs, but the compiled executable doesn't work correctly on Asus eeePC (1024x600x32) WinXP/Home.
Screen open but no refresh or drawing appears on the screen (sometimes black screen, sometimes I see my desktop image)
The executable might not be able to find the 3D engine.
You need to put the Engine3d.dll in the same directory as the executable.
You can find that dll in Purebasic's Compilers folder.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by IdeasVacuum »

It may be the EeePC just does not have enough graphics hardware capability to support Ogre?
Try InitEngine3D(#PB_Engine3D_DebugLog | #PB_Engine3D_DebugOutput)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
DK_PETER
Addict
Addict
Posts: 904
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by DK_PETER »

[quote="endo"]InitEngine3D doesn't fail and the code runs, but the compiled executable doesn't work correctly on Asus eeePC (1024x600x32) WinXP/Home.
Screen open but no refresh or drawing appears on the screen (sometimes black screen, sometimes I see my desktop image)

Hey Endo.

Good suggestions from IdeasVacuum and Samuel.

Are you sure about the resolution? My wife had an Asus eee pc (2007) (Max resolution was 800*400 on a 7 inch screen).

Try this to see available screen resolutions:

Code: Select all

If InitSprite() = 0
	End
EndIf

Procedure GetAvailableScreenModes()
	  If ExamineScreenModes()
	  	While NextScreenMode()
	  	Debug Str(ScreenModeWidth()) + "*" + Str(ScreenModeHeight()) + "," + ScreenModeDepth() + "@" + ScreenModeRefreshRate()
	    Wend
	  EndIf
EndProcedure

GetAvailableScreenModes()
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
endo
Enthusiast
Enthusiast
Posts: 141
Joined: Fri Apr 30, 2004 10:44 pm
Location: Turkiye (istanbul)
Contact:

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by endo »

Thank you all for the replies. Here are the results, none of them successed:

* I've copied the Engine3D.dll into the same folder where the "PureBasic_Compilation0.exe" created.
* I've compiled the code into .exe and put the Engine3D.dll into same folder.
* I'm sure about the screen resulation as my desktop is 1024x600x32 and when I remove InitEngine3D() it works.
* I've listed all resulation 1024*600,32@60 is there.
* I've changed to 800x600x32, I see black screen.
* InitEngine3D(#PB_Engine3D_DebugLog | #PB_Engine3D_DebugOutput) gives me some log with no error or warning. Here is the some lines from the log:

Code: Select all

00:34:11: *-*-* OGRE Initialising
00:34:11: *-*-* Version 1.8.2 (Byatis)
00:34:11: D3D9 : Direct3D9 Rendering Subsystem created.
00:34:11: D3D9: Driver Detection Starts
00:34:11: D3D9: Driver Detection Ends
...
00:34:11: CPU Identifier & Features
00:34:11: -------------------------
00:34:11:  *   CPU ID: GenuineIntel: Intel(R) Atom(TM) CPU N270   @ 1.60GHz
00:34:11:  *      SSE: yes
00:34:11:  *     SSE2: yes
00:34:11:  *     SSE3: yes
00:34:11:  *      MMX: yes
00:34:11:  *   MMXEXT: yes
00:34:11:  *    3DNOW: no
00:34:11:  * 3DNOWEXT: no
00:34:11:  *     CMOV: yes
00:34:11:  *      TSC: yes
00:34:11:  *      FPU: yes
00:34:11:  *      PRO: yes
00:34:11:  *       HT: no
00:34:11: -------------------------
00:34:11: D3D9 : Subsystem Initialising
00:34:11: Registering ResourceManager for type Texture
00:34:11: Registering ResourceManager for type GpuProgram
00:34:11: ***************************************
00:34:11: *** D3D9 : Subsystem Initialised OK ***
...
00:34:11: D3D9RenderSystem::_createRenderWindow "PureBasic Ogre", 0x0 fullscreen  miscParams: FSAA=0 colourDepth=32 displayFrequency=0 externalWindowHandle=2098272 vsync=true 
00:34:11: D3D9 : Created D3D9 Rendering Window 'PureBasic Ogre' : 1024x600, 32bpp
00:34:11: D3D9 : Multi head disabled. It causes horizontal line when used in XP + VSync combination
00:34:11: RenderSystem capabilities
00:34:11: -------------------------
00:34:11: RenderSystem Name: Direct3D9 Rendering Subsystem
Edit: I use 5.21 demo version on WinXP/Home Edition.
DirectX v9.0c, dxdiag.exe founds no error and all the tests work as normal (ddraw, 7-8-9 are all ok)
I've disabled my Avira antivirus as well.

Still no success.

My main question is why and how InitEngine3D() doesn't return 0?
-= endo (registered user of purebasic since 98) =-
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by Samuel »

Code: Select all

If InitEngine3D() = 0: End: EndIf ;when I remove this line it works as expected
If InitSprite() = 0: End: EndIf
If InitKeyboard() = 0: End: EndIf	
If OpenScreen(1024,600,32,"") = 0: End: EndIf
Repeat
	ClearScreen(RGB(Random(255),Random(255),Random(255)))
	FlipBuffers(): ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
I just noticed that your code is missing RenderWorld().
Which is needed to display the 3D world.
http://www.purebasic.com/documentation/ ... world.html

Try this code.

Code: Select all

If InitEngine3D() = 0
 End
EndIf
If InitSprite() = 0
 End
EndIf
If InitKeyboard() = 0
 End
EndIf	
If OpenScreen(1024,600,32,"") = 0
 End
EndIf
Repeat
  ExamineKeyboard()
  ClearScreen(RGB(Random(255),Random(255),Random(255)))
  RenderWorld()
  FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
End
endo
Enthusiast
Enthusiast
Posts: 141
Joined: Fri Apr 30, 2004 10:44 pm
Location: Turkiye (istanbul)
Contact:

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by endo »

I've tried your code, no success unfortunately.
I tried all combinations of the order of FlipBuffer(), RenderWorld(), ClearScreen(), no change.
On 1024x600 I see a flickering screen (complete black and my desktop image), if I change it to 800x600 then black screen only.
-= endo (registered user of purebasic since 98) =-
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by IdeasVacuum »

Isn't it the case that ClearScreen() does not respect the colour input? Thought I read that somewhere on the forum, but I could be wrong.
Try this variation:

Code: Select all

If InitEngine3D(#PB_Engine3D_DebugLog | #PB_Engine3D_DebugOutput) = 0 : End : EndIf
If   InitSprite() = 0 : End : EndIf
If InitKeyboard() = 0 : End : EndIf
 
If OpenScreen(1280,1024,32,"") = 0 : End : EndIf ; <-- Set your screen resolution here

Repeat
        ExamineKeyboard()
           Debug Random(255)
             RandomSeed(Random(10))
            ClearScreen(RGB(Random(255),Random(255),Random(255)))
                  Delay(300)
            RenderWorld()
            FlipBuffers()

Until KeyboardPushed(#PB_Key_Escape)

End
Couple of notes:
1) Post your entire Ogre Log. Let the experts decide if a value is pertinent or not.
2)
I use 5.21 demo version on WinXP/Home Edition.
.
There might be a limitation in the demo version. The code above should flash your screen approx every 300milisecs. On mine, the Screen is only ever flashed black (Normal desktop is seen in between).
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by IdeasVacuum »

A Windowed Screen version - flashes the background randomly:

Code: Select all

If InitEngine3D(#PB_Engine3D_DebugLog | #PB_Engine3D_DebugOutput) = 0 : End : EndIf
If   InitSprite() = 0 : End : EndIf
If InitKeyboard() = 0 : End : EndIf

     If OpenWindow(5,0,0,840,640,"Window", #PB_Window_ScreenCentered)

            StickyWindow(5,#True)

            If OpenWindowedScreen(WindowID(5), 20, 20, 800, 600, 0, 0, 0)

                                 CreateCamera(11, 0,  0, 100, 100)
                         CameraProjectionMode(11, #PB_Camera_Orthographic)
                                  CameraRange(11, 1, 500000)

                                   MoveCamera(11, 0,  0, 800, #PB_Absolute|#PB_World)
                                 CameraLookAt(11, 0,  0,  0)

                  Repeat
                          ExamineKeyboard()

                               RandomSeed(Random(10))
                             ;ClearScreen(RGB(Random(255),Random(255),Random(255)))
                          CameraBackColor(11, RGB(Random(255),Random(255),Random(255)))
                                    Delay(300)
                              RenderWorld()
                              FlipBuffers()

                  Until KeyboardPushed(#PB_Key_Escape)
            EndIf
     EndIf
End
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by Samuel »

I think I know what's wrong with your code, endo.
This is taken from the help files on OpenScreen().
Width and Height should be standard combinations: 640*480, 800*600, 1024*768...
The resolution your using is not a very common one. Try using 800 for the width and 600 for the height.

Code: Select all

OpenScreen(800, 600, 32, "Test")
If you need a resolution of 1024*600 then I'd recommend using a OpenWindowedScreen() instead.

EDIT:
I just noticed that you said in a previous post that you already tried different resolutions. :oops:
I guess I need to pay better attention.

EDIT #2:

After thinking about it for a while I don't think ClearScreen() will work in a 3D world.
When you use the 3D world you can no longer draw directly to the screen.
You need to draw to a sprite then display that sprite on the screen.
So, if I'm correct ClearScreen() is no longer necessary after you activate the 3D engine.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by Danilo »

Samuel wrote:EDIT #2:
After thinking about it for a while I don't think ClearScreen() will work in a 3D world.
When you use the 3D world you can no longer draw directly to the screen.
You need to draw to a sprite then display that sprite on the screen.
So, if I'm correct ClearScreen() is no longer necessary after you activate the 3D engine.
I think when using InitEngine3D() you need to create a camera first. ClearScreen() is then replaced by CameraBackColor().

Code: Select all

If InitEngine3D(#PB_Engine3D_DebugLog | #PB_Engine3D_DebugOutput) = 0 : End : EndIf
If   InitSprite() = 0 : End : EndIf
If InitKeyboard() = 0 : End : EndIf

If OpenScreen(1024,600,32,"") = 0 : End : EndIf ; <-- Set your screen resolution here
;If OpenScreen(1600,1200,32,"") = 0 : End : EndIf ; <-- Set your screen resolution here

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

; CreateCube(0,10)
; 
; If CreateTexture(0,256,256)
;     If StartDrawing(TextureOutput(0))
;         Box(0,0,OutputWidth(),OutputHeight(),RGB(255,255,0))
;         Box(3,3,OutputWidth()-6,OutputHeight()-6,RGB(0,0,128))
;         StopDrawing()
;     EndIf
;     CreateMaterial(0, TextureID(0))    
;     CreateEntity(0, MeshID(0), MaterialID(0))
;     SetEntityMaterial(0, MaterialID(0))
;     MoveEntity(0,0,0,-100)
; EndIf

Repeat
    ExamineKeyboard()
    ;ClearScreen(RGB(Random(255),Random(255),Random(255)))
    CameraBackColor(1,RGB(Random(255),Random(255),Random(255)))
    
    If IsEntity(0):RotateEntity(0,1,1,1,#PB_Relative):EndIf
    
    RenderWorld()
    
    ; display sprites here, after RenderWorld
        
    FlipBuffers()
    ;Delay(20)

Until KeyboardPushed(#PB_Key_Escape)

End
So endo's minimalistic example should be:

Code: Select all

If InitEngine3D() = 0: End: EndIf
If InitSprite() = 0: End: EndIf
If InitKeyboard() = 0: End: EndIf   
If OpenScreen(1024,600,32,"") = 0: End: EndIf
CreateCamera(0,0,0,100,100)
Repeat
    CameraBackColor(0,RGB(Random(255),Random(255),Random(255)))
    RenderWorld():FlipBuffers(): ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by Samuel »

Danilo wrote: I think when using InitEngine3D() you need to create a camera first. ClearScreen() is then replaced by CameraBackColor().
I guess I've been over thinking things. Not enough sleep and too much on the mind.
My previous posts are probably all irrelevant to his issue.
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by PMV »

CameraBackColor() is just used for 3d-scene, where there is nothing
to render. For example if you look into the sky but doesn't have a
skybox or skydome. If your camera dimension is 100%, there is no
free space that ClearScreen() could effect. But even if you use
a camera of just 90%, where clearly is a free border ... it has no
effect for me.

Looks like ClearScreen() is ignored when InitEngine3D() was used.
Or RenderWorld() just renders the complete screen and all pixel
get initialized by black and will overwrite ClearScreen() always.

MFG PMV
endo
Enthusiast
Enthusiast
Posts: 141
Joined: Fri Apr 30, 2004 10:44 pm
Location: Turkiye (istanbul)
Contact:

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by endo »

Thank you for all, I'll try your suggestions at home.
-= endo (registered user of purebasic since 98) =-
endo
Enthusiast
Enthusiast
Posts: 141
Joined: Fri Apr 30, 2004 10:44 pm
Location: Turkiye (istanbul)
Contact:

Re: InitEngine3D problem on AsusEeePC 1024x600 XP/Home

Post by endo »

I just tested on my work PC, same result! So the problem is not about the PC or there is no problem at all.
ClearScreen doesn't behave as *expected* if InitEngine3D is used.

Edit: I just realized that when InitEngine3D is used drawing directly onto screen is (may?) not working:

Code: Select all

InitEngine3D(): InitSprite(): InitKeyboard(): OpenScreen(800,600,32,"")
Repeat
  If StartDrawing(ScreenOutput())   ; <<--- "The specified output is NULL" error!
    DrawText(120,80,"Hello world!")
    StopDrawing()
  EndIf
Until KeyboardPushed(#PB_Key_Escape)
-= endo (registered user of purebasic since 98) =-
Post Reply