DX9 Subsystem v0.5

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

I definately have an eye on this, great work, and awesome job!

Now for the bad question ... ... :) IS there any way not to require a DLL file? Maybe even with the option of a pb lib or some such instead? I understand it would make the EXE huge as hell, but ..... *shrugs* ?
S.M.
Enthusiast
Enthusiast
Posts: 118
Joined: Sat Apr 24, 2004 1:11 pm
Contact:

Post by S.M. »

IS there any way not to require a DLL file?
Yes, as soon as I can compile it correctly with TailBite.
If that is not possible I can also make the Userlib manually.(but not at this stage)
I understand it would make the EXE huge as hell
The EXE wouldn't be that huge, it will be probably a bit bigger than with the normal Libraries.
The DLL is only that huge, because I included all Image Plugins :D
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

oo, heheh, awesome! I'll definately throw this bad-boy in my next project.
S.M.
Enthusiast
Enthusiast
Posts: 118
Joined: Sat Apr 24, 2004 1:11 pm
Contact:

Post by S.M. »

Hi
Ok, now I wrote the complete Sound Library (with OGG support)
I hope now a few more people could test the subsystem. :D
Can you get some of your projects working?
regards
Stefan
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Thanks, because this is a very promising lib. :D
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
THCM
Enthusiast
Enthusiast
Posts: 276
Joined: Fri Apr 25, 2003 5:06 pm
Location: Gummersbach - Germany
Contact:

Post by THCM »

Hi Stefan,

I tried the new lib with my game, but I get an Invalid Memory Access error on this line:

LeftButton = MouseButton(1)

Any Idea?
The Human Code Machine / Masters' Design Group
S.M.
Enthusiast
Enthusiast
Posts: 118
Joined: Sat Apr 24, 2004 1:11 pm
Contact:

Post by S.M. »

@THCM
Thanks! :D
The bug should be fixed, can you test ? (just download agian)
hehe, post nb. 100
THCM
Enthusiast
Enthusiast
Posts: 276
Joined: Fri Apr 25, 2003 5:06 pm
Location: Gummersbach - Germany
Contact:

Post by THCM »

Hi Stefan,

compilation bug is gone, but my game runs like a diashow. Tried to play around with Setframerate and flipbuffers, but didn't change anything. Later on I'll take a closer look.
The Human Code Machine / Masters' Design Group
THCM
Enthusiast
Enthusiast
Posts: 276
Joined: Fri Apr 25, 2003 5:06 pm
Location: Gummersbach - Germany
Contact:

Post by THCM »

Hi,

I tested a little bit further: I changed all sprite-load and catch commands to #PB_Sprite_Memory and now it runs at about 15 fps (original spritelib is about 30 times faster). I can move around the mouse, but no clicks will be recognized and I can't exit using the keyboard by pressing ESC.

I can't mix Ogre-Graphics with your Sprite-Lib. At the moment I use the skybox as background in my game.

Hope you can fix it!
The Human Code Machine / Masters' Design Group
S.M.
Enthusiast
Enthusiast
Posts: 118
Joined: Sat Apr 24, 2004 1:11 pm
Contact:

Post by S.M. »

@THCM
Great! :D
Do you use one of these slow commands in the main loop ?
TransparentSpriteColor()
UseBuffer()
GrabSprite()
CopySprite()
CreateSprite()
The others should be at least as fast as the dx7 commands.
I can move around the mouse, but no clicks will be recognized and I can't exit using the keyboard by pressing ESC.
I will have a look.
I can't mix Ogre-Graphics with your Sprite-Lib. At the moment I use the skybox as background in my game.
Sorry, OGRE is not planed for now, I think I would need Freds help for this.
Instead I plan to add a few extension Libraries.In the case of 3D I will use D3DX.
THCM
Enthusiast
Enthusiast
Posts: 276
Joined: Fri Apr 25, 2003 5:06 pm
Location: Gummersbach - Germany
Contact:

Post by THCM »

Yes, I use Usebuffer 2 times in the mainloop. I first draw all my sprites to a bigger playfield-sprite and this sprite will be displayed on the main-screen. Here my simplified mainloop:

Code: Select all

IngameLoop:

Repeat
	Screen3DEvents()

	ClearScreen(RGB(0,0,0))

	StartDrawing(ScreenOutput())

	DrawingMode(1)

	If StarField
		Gosub DoStarField
	EndIf
	
	StopDrawing()

	Gosub DrawPanel

	UseBuffer(#PlayFieldID)

	Gosub CheckMouse

	Gosub DrawLevel

	OldViewPortX = ViewPortX
	OldViewPortY = ViewPortY

	Select CursorMode

		Case 0
		Gosub MoveCursor

		Case 1
		Gosub OrbSelected
		Gosub AnimOrb

		Case 2
		Gosub MoveOrb
		Gosub AnimOrb

		Case 3
		Gosub SpecialEffect
		If EffectNumber <OrbDeath> #Levels-1
				NewLevel = #Levels-1
			EndIf

			Gosub InitFadeOut

		ElseIf KeyboardReleased(#PB_Key_Down)
			If KeyboardPushed(#PB_Key_LeftShift) Or KeyboardPushed(#PB_Key_RightShift)
				NewLevel = Level - 10
			Else
				NewLevel = Level - 1
			EndIf

			If NewLevel < 0
				NewLevel = 0
			EndIf

			Gosub InitFadeOut

		ElseIf KeyboardReleased (#PB_Key_Space)

			Gosub InitFadeOut
		EndIf

	EndIf

	If OrbsLeft = 0
		NewLevel = Level + 1
			
			If NewLevel = #Levels
				NewLevel = 0
			EndIf

		Gosub InitFadeOut
		OrbsLeft = 1

	EndIf

	UseBuffer(#PB_Default)
	ClipSprite(#PlayFieldID, OldViewPortX, OldViewPortY, ViewPortSizeX, ViewPortSizeY)
	DisplayTransparentSprite(#PlayFieldID, ScreenOffsetX, ScreenOffsetY)
	Gosub DrawBorder

	If KeyboardReleased(#PB_Key_S)
		SaveScreen()
	EndIf


	Select CursorMode
		Case 4
		Gosub DisplayFadeIn

		Case 5
		Gosub DisplayFadeOut

	EndSelect

	Screen3DStats()

	FlipBuffers(1)
Until KeyboardReleased(#PB_Key_Escape)

Return
The Human Code Machine / Masters' Design Group
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

When I extracted the file, only the Screen and Sprite libraries under userlibs have any data in them, Everything else is zero bytes. Also, the dll in the Compilers directory is bigger (and a day older) then the dll in the DX9Stest directory. Which is is safer to use?

Also, any chance to remove that annoying popup on use of the sub system? lol.

Another quick question .. ... :) Can we create a 3d sprite w/o a 2d sprite as there is no longer directdraw?
S.M.
Enthusiast
Enthusiast
Posts: 118
Joined: Sat Apr 24, 2004 1:11 pm
Contact:

Post by S.M. »

A new version is available.
I included the complete Joystick library.

@THCM
I can move around the mouse, but no clicks will be recognized and I can't exit using the keyboard by pressing ESC.
Are you sure, here it seems to work. Can you test again ?
If the issue is still there, can you please write me a small example which shows this.
Yes, I use Usebuffer 2 times in the mainloop.
Sorry, at the moment I don't know how to improve the performance of this.
@Shannara
When I extracted the file, only the Screen and Sprite libraries under userlibs have any data in them, Everything else is zero bytes.
Yes, they are only there that the PB Compiler don't use the normal libs. All commands are in the Sprite-Lib.
Also, any chance to remove that annoying popup on use of the sub system? lol.
Yes, as soon as the Lib works more stable.
Another quick question .. ... Can we create a 3d sprite w/o a 2d sprite as there is no longer directdraw?
No, because it should work the same way as with DX7.
Last edited by S.M. on Thu Jul 27, 2006 8:47 pm, edited 1 time in total.
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Thanks for the answers :)
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Hmm, then my other question is .... will this subsystem be free, or will it cost? Basically, I am hoping to use this in 3 different projects, but cannot use the sub system at this time due to popup.
Post Reply