[PB 4.20] [ogre] InitEngine3D() causing Alt+Tab hang

All bugs related to the 3D engine
THCM
Enthusiast
Enthusiast
Posts: 276
Joined: Fri Apr 25, 2003 5:06 pm
Location: Gummersbach - Germany
Contact:

Taskwitching while using Ogre

Post by THCM »

Hi Fred,

when I try to switch tasks (alt+tab) with your new debug version of Ogre, I'll get a Microsoft Visual C Runtime error. Tested with and without debugger and a standalone compiled exe.

Yours
The Human Code Machine / Masters' Design Group
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

[PB 4.20] [ogre] InitEngine3D() causing Alt+Tab hang

Post by djes »

As said there, when doing an alt-tab and coming back a crash occurs.

Code: Select all

CompilerIf Defined(D3DBLEND_ZERO, #PB_Constant)=0
   #D3DBLEND_ZERO=1
   #D3DBLEND_ONE=2
   #D3DBLEND_SRCCOLOR=3
   #D3DBLEND_INVSRCCOLOR=4
   #D3DBLEND_SRCALPHA=5
   #D3DBLEND_INVSRCALPHA=6
   #D3DBLEND_DESTALPHA=7
   #D3DBLEND_INVDESTALPHA=8
   #D3DBLEND_DESTCOLOR=9
   #D3DBLEND_INVDESTCOLOR=10
   #D3DBLEND_SRCALPHASAT=11
   #D3DBLEND_BOTHSRCALPHA=12
   #D3DBLEND_BOTHINVSRCALPHA=13
CompilerEndIf

InitEngine3D() ;<- Guilty!
InitSprite()
InitSprite3D()
InitKeyboard()
InitMouse()
OpenScreen(1024, 768, 32, "Custom PB Sprite3D")

CreateSprite(1, 256, 256, #PB_Sprite_Texture)
StartDrawing(SpriteOutput(1))
   Box(0, 0, 256, 256, RGB(255, 200, 100))
   Box(0, 0, 50, 50, $FFFFFF ! RGB(255, 200, 100))
   Box(50, 50, 50, 50, $FFFFFF ! RGB(255, 200, 100))
   Box(236, 0, 20, 256, RGB(161, 87, 177))
StopDrawing()

Sprite3DQuality(#PB_Sprite3D_BilinearFiltering)
CreateSprite3D(1, 1)
CreateSprite3D(2, 1)
CreateSprite3D(3, 1)

ZoomSprite3D(1, 256, 256)
ZoomSprite3D(2, 128, 128)
ZoomSprite3D(3, 64, 64)

Procedure DoScreenDisplay()
   ExamineKeyboard()
   ExamineMouse()
   Protected x=MouseX()
   Protected y=MouseY()
   
   ClearScreen(RGB(0, 0, 0))
   Start3D()
      Sprite3DBlendingMode(#D3DBLEND_SRCALPHA, #D3DBLEND_INVSRCALPHA)
      DisplaySprite3D(1, 100, 200)
     
      Sprite3DBlendingMode(#D3DBLEND_INVDESTCOLOR, #D3DBLEND_SRCALPHA)
      RotateSprite3D(2, 1, 1)
      For pos=3 To 8
         DisplaySprite3D(2, pos*60, 290)
      Next
     
      Sprite3DBlendingMode(#D3DBLEND_SRCALPHA, #D3DBLEND_INVSRCALPHA)
      DisplaySprite3D(3, x, y, 100)
     
   Stop3D()   
   FlipBuffers()
EndProcedure

Procedure GoBackToOS()
   ReleaseMouse(1)
   Repeat
      FlipBuffers()
   Until IsScreenActive()
   ReleaseMouse(0)
EndProcedure

Repeat
   DoScreenDisplay()
   
   ;/// Manage ALT TAB
   If Not IsScreenActive()
      GoBackToOS()
   EndIf
Until KeyboardPushed(#PB_Key_Escape)

CloseScreen()
End 
Last edited by djes on Wed Jul 23, 2008 8:24 am, edited 3 times in total.
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

Sprite3D and Engine3D are not fully compatible
Syntax

RenderWorld()
Description

Renders the whole world on the screen. This function should be called once all 3D operations are finished and only one time per frame.

Once the RenderWorld() function has been performed, it's possible to use regular 2D functions like DisplaySprite() to display 2D sprites over the 3D world (note: Sprite3D is not supported though).
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Alt+Tab is the only error I saw, except that, sprites3D and ogre are working perfectly together all the time. In my example, I didn't even used 3d.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

it does not matter if only half is functional, 80% are functional, or only one single little thing is not functional...
(on your PC, can be different on many others)

"not supported" does mean "not supported"...

if it partly functions tho, use this part, but don't claim support for something "not supported". ;)
oh... and have a nice day.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

How could you ask this to an ex-demomaker! :twisted:

Btw, Purebasic is an excellent language, and this request is, like others I've sent, to push its limits. Pure has never been frozen! And I've always used what I've requested. In this case, my product is near its commercial launch, and it would be a pain to withdraw all 3d stuff. :(

More than that, maybe that this alt-tab bug is showing something really ugly under the hood, that could help Fred in his future ogre implementations.
Post Reply