Mirage Source
http://www.miragesource.net/forums/

DX7 and Class Demo *ver 1.4*
http://www.miragesource.net/forums/viewtopic.php?f=143&t=5555
Page 1 of 1

Author:  GIAKEN [ Thu Apr 30, 2009 4:12 am ]
Post subject:  DX7 and Class Demo *ver 1.4*

Here's a demonstration of some simple DirectX7 DirectDraw and using a class to do it ;) "Follow the Mouse"!

Version 1.1: Nearly completely rewritten my class...it does nearly everything for you now.

Version 1.2: Added more options for the class so you can set how it loads surfaces and so on. I think there's more...I forget.

Version 1.3: Changed how you set the current surface used and surface RECT. Made the .Draw function only need an X and Y :) Fixed a problem with the Display so it used the picture box you set at initialization...and added 3 more drawing so there's a box around your mouse to show off how I fixed the surfaces so they don't go out of the area. Changed a lot of the comments...this project should be like a book now :P

Version 1.4: Added in sound and music support! It's complete support, too. Music stopping, volume control, sound buffering (up to 50 sounds at once), and so on :D Also set up all the init calling to work off each other. IE you can InitSound first, then if you want to initdrawing or music you don't need to provide a form, it will use the form from InitSound...also you don't have to init drawing or music or sound if you don't want to, you can use any of the 3 you want or you can use them all!

Attachment:
Follow the Mouse5.rar [61.67 KiB]
Downloaded 372 times

Author:  GIAKEN [ Fri May 01, 2009 2:43 am ]
Post subject:  Re: DX7 and Class Demo *Version 2*

And here's version 2 :) This one is A LOT different.

Surfaces are now initialized a lot differently
Class uses its own gettickcount
Class calculates the FPS for you
Drawing is the GDI now instead of DD
Class is now destroyed properly
Surfaces are handled a lot differently
And so much more :D

I changed it A LOT. You should be able to add this class to your project and go now :D You shouldn't have to edit the class at all...I added options for you so you can set your form and picture box you're using and the fonts and such...it's neat.

Author:  TehWiz [ Fri May 01, 2009 3:26 am ]
Post subject:  Re: DX7 and Class Demo *Version 2*

Sehr, sehr nett!

Author:  Tony [ Fri May 01, 2009 3:33 am ]
Post subject:  Re: DX7 and Class Demo *Version 2*

Yeah, you can easily learn how to use classes by looking at the source.

Author:  Nean [ Fri May 01, 2009 3:35 am ]
Post subject:  Re: DX7 and Class Demo *Version 2*

This project made me feel very uncomfortable. I don't recommend using it.

Author:  GIAKEN [ Fri May 01, 2009 2:34 pm ]
Post subject:  Re: DX7 and Class Demo *ver 1.2*

Fuck you Nean :P

Just did a new version!

Author:  GIAKEN [ Fri May 01, 2009 7:49 pm ]
Post subject:  Re: DX7 and Class Demo *ver 1.3*

And another version!

Author:  Tony [ Fri May 01, 2009 8:10 pm ]
Post subject:  Re: DX7 and Class Demo *ver 1.3*

DX7 should be easier to use now for people who don't understand it as well.

Very nice work. Keep it up.

Author:  GIAKEN [ Thu May 21, 2009 4:42 am ]
Post subject:  Re: DX7 and Class Demo *ver 1.4*

Awwwwwwww yeahhhhhhhhhhhhhhhhh

1.4 released :P Sound and music is now supported! Enjoy :D

The only thing I have left to do is add in BltToDC so you can draw onto picture boxes...and then that should be full DirectX 7 support. Then I might do optionals like alpha blending :D

Anyways, how is it? :D

Author:  Nean [ Fri Jun 05, 2009 3:56 am ]
Post subject:  Re: DX7 and Class Demo *ver 1.4*

I'm pretty sure that this class module is causing a pretty gnarly memory leak. So far me and GIAKEN haven't been able to find it (Granted, neither of us have put an extroardinary amount of time into searching)

Author:  GIAKEN [ Fri Jun 05, 2009 2:46 pm ]
Post subject:  Re: DX7 and Class Demo *ver 1.4*

The memory leak I found, though, was with sound buffering (also going to be a memory leak with MS4). When a sound is finished playing, it doesn't clear out. So you could potentially load up 50 (or however much your buffer count is set to) sounds...I have a fix for that, that me and Nean tried and worked, but there's still a memory leak Nean says.

Author:  Nean [ Fri Jun 05, 2009 8:44 pm ]
Post subject:  Re: DX7 and Class Demo *ver 1.4*

GIAKEN wrote:
The memory leak I found, though, was with sound buffering (also going to be a memory leak with MS4). When a sound is finished playing, it doesn't clear out. So you could potentially load up 50 (or however much your buffer count is set to) sounds...I have a fix for that, that me and Nean tried and worked, but there's still a memory leak Nean says.


I think it might have to do with the FPS, with the sleep function.

Author:  GIAKEN [ Sat Jun 06, 2009 4:23 am ]
Post subject:  Re: DX7 and Class Demo *ver 1.4*

Umm definitely not...unless it was changed from Sleep 1 to something else.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/