PureGDK Open Beta - DarkBasic for PureBasic

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
sigi
User
User
Posts: 79
Joined: Fri Apr 25, 2003 7:16 pm
Location: Germany

Post by sigi »

Hu ?
It is the same now with or without constants. That`s good.

But the DBWindow output is much smaller now then before. It doesn`t fill
the PBWindow full, only the half (not nearly). In width and height.
Athlon X2 7850 - Geforce 8800 GTS 640mb - 8 GB Ram - Vista Home Premium 64 bit SP2
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Sorry about that. Sometimes one line makes all the difference.

Code: Select all

0.4.6b - Feb. 25, 2008 Changelog:

    * Fixed a bug that occurred in 0.4.5 where the code that changed the dimensions of the DarkBasic render window after altering its resolution was left out.
    * Removed the dbSetWindowLayout() command from the display library. This command is obsolete with the commands already available within PureBasic. 
sigi
User
User
Posts: 79
Joined: Fri Apr 25, 2003 7:16 pm
Location: Germany

Post by sigi »

No problem, i would like to see this as stable as possible. Works great now. :)
Athlon X2 7850 - Geforce 8800 GTS 640mb - 8 GB Ram - Vista Home Premium 64 bit SP2
Morty
User
User
Posts: 35
Joined: Mon Mar 19, 2007 8:30 am
Location: Germany
Contact:

Post by Morty »

Hi.

I get the following error when i try to compile (in PureBasic) an example.
It comes on all examples.

Code: Select all

Compiling DarkBasic Professional source...
Error: Command in DLL command-table unrecognised (Enumerate[%L%Enumerate)
Since I installed PureGDK this error also appears when I compile in DarkBasic. But in DarkBasic the error has no bearing/influence on the execution, all runs fine.

oh god, my bad english ... sorry :oops:

I hope you can help, I'm very intrested in this.

Morty
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Are you running latest version of DarkBasic Professional, 6.6b?

Try copying this file over the PureGDK.dll in your ..\Dark Basic Professional\Compiler\plugins-user directory. Let me know if this fixes your problem.
http://puregdk.com/files/PureGDK-dll.zip
Morty
User
User
Posts: 35
Joined: Mon Mar 19, 2007 8:30 am
Location: Germany
Contact:

Post by Morty »

Thanks,
I will try it in the evening. I'm not at home now.

Another question: How could I uninstall PureGDK?

Morty
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

There is no uninstaller yet. If you want to remove PureGDK manually follow these steps:
  • Delete all PureGDK tools from the PureBasic IDE
  • Delete the PureGDK folder (default location is Purebasic\PureGDK)
  • Delete all of the PureGDK userlibraries (PureBasic\PureLibraries\UserLibraries)
  • Delete the PureGDK DarkBasic Professional DLL in the Compiler\plugins-user folder of your DarkBasic Professional installation
  • Delete the PureGDK resident file (PureBasic\Residents)
Morty
User
User
Posts: 35
Joined: Mon Mar 19, 2007 8:30 am
Location: Germany
Contact:

Post by Morty »

Hi.

I don't know what's happened, but I deleted everything and made a fresh install of PureGDK (the latest version) and now it runs fine :D
Didn't have tested all examples but now it works.

Morty
vogdet
New User
New User
Posts: 4
Joined: Sat Mar 01, 2008 4:48 pm

i am crazy

Post by vogdet »

booaah i can not compile it.
i will compile and i become a 'invalid memory access' :shock:

what is it ?










sorry for my bad english
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Please post your code that generates the invalid memory access.
sigi
User
User
Posts: 79
Joined: Fri Apr 25, 2003 7:16 pm
Location: Germany

Post by sigi »

Can we have a ported example from the ultimate shader pack please?
I have tried to convert Evolveds Environmentbumpmapping example, but
can`t get it to work. No textures and no shaders visible.
Athlon X2 7850 - Geforce 8800 GTS 640mb - 8 GB Ram - Vista Home Premium 64 bit SP2
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

You're probably getting a black screen because you forgot to swap the StageIndex and ImageID parameters in dbTextureObject().

You'll also have to remove the VSync parameter from dbSetDisplayMode() as this is bugged but has been fixed for the next beta.

The shader isn't working right with the debugger off. I'm still trying to figure out why.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

New beta!
0.4.7b - Mar. 1, 2008 Changelog:

* Fixed a bug where dbSetWindowSize() would cause an invalid memory access error if it was called before any other PureGDK command.
* Added the command GetDBWndHandle() to find out the window handle of the DarkBasic render window at any time.
* Added the 0.4.1b dbSetAlphaMappingOn() fix to the installer. This bug was fixed but was not deployed.
* Fixed a bug where functions that passed one or no parameters did not properly catch runtime errors if the debugger was off.
* Fixed a bug which would cause dbSetDisplayMode() to fail if the VSync parameter was used and the debugger was on.
* Fixed a bug where DBPro variables were not being sent properly to .fx files when the debugger was on.
* dbSetWindowOff() has been removed. PureGDK is not designed to work with full-screen exclusive applications. Use #GDK_Window_Borderless and match the window to the screen resolution instead.
And here is an example from the Ultimate Shader Pack.

Code: Select all

; -----------------------
;  offset mapping
; -----------------------
;  By Evolved
;  http://www.vector3r.com/
; -----------------------

; show the PureGDK render window
  hDBWnd=OpenDBWnd(0,0,640,480,32,#GDK_Window_SystemMenu|#GDK_Window_ScreenCentered)

; Set Up Display
  dbSetWindowTitle("Offset Mapping")
  OpenLibrary(0,"user32.dll")
  Sw=CallFunctionFast(GetFunction(0,"GetSystemMetrics"),0)
  Sh=CallFunctionFast(GetFunction(0,"GetSystemMetrics"),1)
  CloseLibrary(0)
  dbSetDisplayMode(Sw,Sh,32,1)
  dbMaximizeWindow()
  dbSyncOn(): dbSyncRate(60)

; Set Text
  dbSetTextFont("Verdana")
  dbSetTextSize(13)
  dbSetTextBold()
  dbInk(dbRGB(175,175,175),0)

; Setup Camera
  dbAutoCamOff()
  CamDis.f=-200

; Load Textures
  dbLoadImage("Media/rockwall.tga",1)
  dbLoadImage("Media/rockwall_height.tga",2)

; Create Object
  dbLoadEffect("FX/OffsetMapping.fx",1,0)
  dbSetEffectConstantFloat(1,"U",1.0)
  dbMakeObjectBox(1,75,75,75): object=1
  dbTextureObject(1,1,0)
  dbTextureObject(1,2,1)
  dbSetObjectEffect(1,1)

; Create floor
  dbLoadEffect("FX/OffsetMapping.fx",2,0)
  dbSetEffectConstantFloat(2,"U",5.0)
  dbSetEffectConstantFloat(2,"V",5.0)
  dbMakeObjectBox(2,500,1,500)
  dbPositionObject(2,0,-65,0)
  dbTextureObject(2,1,0)
  dbTextureObject(2,2,1)
  dbSetObjectEffect(2,2)

; Create Sky
  dbLoadImage("Media/Sky.dds",3,2)
  dbLoadEffect("FX/Sky.fx",3,0)
  dbMakeObjectSphere(3,2000,5,5)
  dbSetObjectEffect(3,3)
  dbSetObjectCull(3,0)
  dbTextureObject(3,3,0)

; -----------------------
; Start loop
  Repeat
      
; Text
  dbText(15,15,"Space - Change Object      R - Rotate Object")
  dbText(15,40,"FPS  "+Str(dbScreenFPS()))

; Control Camera
  dbPositionCamera(0,0,0)
     If dbMouseClick()=1
        dbXRotateCamera(dbCameraAngleX()-dbMouseMoveY()*0.25)
        dbYRotateCamera(dbCameraAngleY()+dbMouseMoveX()*0.25)
     EndIf
  If dbMouseClick()=2
  	CamDis.f=CamDis.f-dbMouseMoveY()*0.25
  EndIf
  CamDis.f=CamDis.f+dbMouseMoveZ()*0.25
     If dbCameraAngleX()>80: dbXRotateCamera(80): EndIf
     If dbCameraAngleX()<-60: dbXRotateCamera(-60): EndIf
     If dbUpKey()=1: CamDis.f=CamDis.f+2.5: EndIf
     If dbDownKey()=1: CamDis.f=CamDis.f-2.5: EndIf
     If CamDis.f>-70: CamDis.f=-70: EndIf
     If CamDis.f<-300: CamDis.f=-300: EndIf
  dbMoveCamera(CamDis.f)
  If dbCameraPositionY()<-60
  	dbPositionCamera(dbCameraPositionX(),-60,dbCameraPositionZ())
	EndIf
	
; Rotate object
  If dbKeyState(19)=1 And rotate=1 And nopress=0: rotate=0: nopress=1: EndIf
  If dbKeyState(19)=1 And rotate=0 And nopress=0: rotate=1: nopress=1: EndIf
  If rotate=0
     dbRotateObject(1,dbObjectAngleX(1)+0.25,dbObjectAngleY(1)+0.25,dbObjectAngleZ(1)+0.25)
  EndIf

; Change Object
  If dbSpaceKey()=1 And nopress=0
     dbDeleteObject(1)
     	object+1
      If object>3: object=1: EndIf
      If object=1: dbMakeObjectBox(1,75,75,75): dbSetEffectConstantFloat(1,"U",1.0): EndIf
      If object=2: dbMakeObjectSphere(1,75,40,40): dbSetEffectConstantFloat(1,"U",2.0): EndIf
      If object=3: dbMakeObjectCylinder(1,75): dbSetEffectConstantFloat(1,"U",3.0): EndIf
      dbTextureObject(1,1,0)
			dbTextureObject(1,2,1)
      dbSetObjectEffect(1,1)
     nopress=1
   EndIf

; Reset values
  If dbScanCode()=0: nopress=0: EndIf
  dbMouseMoveX()
  dbMouseMoveY()

; End loop
  dbSync()
  ForEver
sigi
User
User
Posts: 79
Joined: Fri Apr 25, 2003 7:16 pm
Location: Germany

Post by sigi »

Shader example works perfect and thank you for the update. :)
Athlon X2 7850 - Geforce 8800 GTS 640mb - 8 GB Ram - Vista Home Premium 64 bit SP2
vogdet
New User
New User
Posts: 4
Joined: Sat Mar 01, 2008 4:48 pm

Post by vogdet »

i can not compile all your samples.

the error begins on the line ''hDBWnd=OpenDBWnd(.....''


i have purebasic 4.10 and darkbasicpro the full versions.








Sorry for my bad english.
Post Reply