Archived

This topic is now archived and is closed to further replies.

simpleDirectDraw and simpleDirectInput

This topic is 6383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was wondering how interested you people on here would be in a very very very simplified wrapper for DirectDraw and DirectInput..... I have written a wrapper clas (well 3 actually) that completely hides the ugly stuff of direct draw and direct input example: DDObject myObject; // global for Direct draw interface myObject.initDirectDraw(width, height); // direct draw is now set up in fullscreen mode at the specified resolution...it is always 16 bpp as this is the most common bit depth // this has set up your primary and backbuffer surfaces Want to flip them ? myObject.flip(); my?Object.destroy(); // cleans up all the mess ///////////////////////////////////// DDSurface mySurface; mySurface.create("filename.bmp"); // you now have a direct draw surface created from the filename mySurface.draw(xPos, yPos, transparent); // draws it to back buffer and then back buffer can be flipped mySurface.destroy(); // cleans up all the mess //////////////////////////////////// DInput myInput; myInput.initDirectInput(); // creates mouse, keyboard, and one joystick interface if one is attached myInput.getMouseY(); // gets mouse y pos myInput.joystickUP(); // returns true if joystick is up myInput.destroy(); // cleans up all the mess ////////////////////////////////// would you people be interested in something like this there are more functions then what I mentioned but I was just giving an example I am also working on what I am calling DirectText...it writes a text string in a specified font, in a specified size, in a specified color, in a specified position It isn''t finished yet as I am going to add DirectMusic, DirectSound, and possibly DirectPlay later on....(sorry no 3d in the plans yet) Is this something you people would be interested in ? Just want to here some thoughts....... "Now go away or I shall taunt you a second time" - Monty Python and the Holy Grail themGames Productions

Share this post


Link to post
Share on other sites
Actually there are quite a lot of DirectX wrappers around on the net and I (only speaking for my self) prefers to write my own code so that I can write I exactly the way I wan''t it.
Although you will learn a lot by writing it and I''m sure a lot of people would wan''t it, maybe to learn for themselves.

Share this post


Link to post
Share on other sites
I agree with Mr Cucumber, that is I''d prefer to write my own. The advantage of course is customization to the application being developed, although I try to keep things as generic as possible. I''ve also found that it often takes as much time to learn someone else''s functions as to write one''s own. Newbies, however, might appreciate a well documented functional wrapper so don''t let me discourage you...

Share this post


Link to post
Share on other sites
I''ve been trying to write my own wrappers lately but I''ve been having some trouble with 16 bit stuff. I''d like to see what you have done with that... also the bitmap loaders which I am having trouble getting to work. Could you email me a copy if its not too much trouble?

Your wrapper sounds good for new programmers though, or anyone who just wants to churn out a game quickly without having to go through and make directx work.

- Daniel

Share this post


Link to post
Share on other sites
I am actually in the process of creating a simple directx DLL so I can use it in future applications.

I created 2 games using Allegro and DJGPP for DOS last year and if you want to create a game without knowing the code in the background.. it works great. There is even a DirectX version somewhere.. its called winallegro. I would rather create my own library for learning purposes and just to exercise my typing skills =).

Share this post


Link to post
Share on other sites