Mirage Source

Free ORPG making software.
It is currently Sun Dec 14, 2025 11:29 am

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Thu Apr 30, 2009 4:12 am 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: [email protected]
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

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Last edited by GIAKEN on Thu May 21, 2009 4:42 am, edited 3 times in total.

Top
 Profile  
 
PostPosted: Fri May 01, 2009 2:43 am 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: [email protected]
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.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
PostPosted: Fri May 01, 2009 3:26 am 
Offline
Newbie

Joined: Thu Mar 19, 2009 5:57 am
Posts: 1
Sehr, sehr nett!


Top
 Profile  
 
PostPosted: Fri May 01, 2009 3:33 am 
Offline
Persistant Poster
User avatar

Joined: Wed Nov 29, 2006 11:25 pm
Posts: 860
Location: Ayer
Yeah, you can easily learn how to use classes by looking at the source.

_________________
Image


Top
 Profile  
 
PostPosted: Fri May 01, 2009 3:35 am 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: [email protected]
This project made me feel very uncomfortable. I don't recommend using it.

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
PostPosted: Fri May 01, 2009 2:34 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: [email protected]
Fuck you Nean :P

Just did a new version!

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
PostPosted: Fri May 01, 2009 7:49 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: [email protected]
And another version!

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
PostPosted: Fri May 01, 2009 8:10 pm 
Offline
Persistant Poster
User avatar

Joined: Wed Nov 29, 2006 11:25 pm
Posts: 860
Location: Ayer
DX7 should be easier to use now for people who don't understand it as well.

Very nice work. Keep it up.

_________________
Image


Top
 Profile  
 
PostPosted: Thu May 21, 2009 4:42 am 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: [email protected]
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

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
PostPosted: Fri Jun 05, 2009 3:56 am 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: [email protected]
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)

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
PostPosted: Fri Jun 05, 2009 2:46 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: [email protected]
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.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
PostPosted: Fri Jun 05, 2009 8:44 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: [email protected]
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.

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
PostPosted: Sat Jun 06, 2009 4:23 am 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: [email protected]
Umm definitely not...unless it was changed from Sleep 1 to something else.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group