Archived

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

dogzer

is there a directx wrapper function library?

Recommended Posts

Hi, not long ago i started learning directx programing (kind of as a hobby) and i see all these long pieces of code for creating a device,etc. I could spend some good time learning the hard code. But what i really want from learning directx is control over pixel drawing and controling the 3d meshes by the vertex, etc. So i was wondering if there is any library with functions that wrap up the device creating code into really short functions (eg. int createdevice(int screenwidth, int screenheight, int screendepth); or something like that. That way i can concentrate on the things i mentioned earlier. I know this sounds really lazy, but i think it would be a good idea if someone did a library like that for beginners.

Share this post


Link to post
Share on other sites
They exist, but they tend to either suck or be geared at higher level problems (and thus overwhelm beginners with complexity from other sources!)

Invest the time to write it for yourself at least once. After that you can always pull out your own function.

If you really don''t want to learn DirectX, though, consider using a game/graphics engine.

Share this post


Link to post
Share on other sites
quote:
Original post by dogzer
Hi, not long ago i started learning directx programing (kind of as a hobby) and i see all these long pieces of code for creating a device,etc.
I could spend some good time learning the hard code.
But what i really want from learning directx is control over pixel drawing and controling the 3d meshes by the vertex, etc.

So i was wondering if there is any library with functions that wrap up the device creating code into really short functions (eg. int createdevice(int screenwidth, int screenheight, int screendepth); or something like that. That way i can concentrate on the things i mentioned earlier.
I know this sounds really lazy, but i think it would be a good idea if someone did a library like that for beginners.



You''re right...it does sound lazy

But seriously, it is only two function calls (Direct3DCreate9() and then IDirect3D9::CreateDevice())...most of what you''re looking at is probably error handling.

How would your simple createdevice() function:

- return a pointer to the actual IDirect3DDevice9?
- specify whether it should be full-screen, hardware/software surface, etc?
- allow you to correctly release the device once you''re done?

Anyway, if you''re not interested in getting at the full power of Direct3D, then just get some sample code, copy&paste that and use that cookie cutter code to get the device and then run like the wind...

Regards,
Jeff





[ CodeDread ]

Share this post


Link to post
Share on other sites
There is the wrapper included with the SDK. Instead of using it, though, why don't you just study it? The major bulk of DX, that I've found, is enumerating all of the different display modes. That's hardly something you need to worry about if you are just experimenting on your own machine, however. I doubt it's exclusive to DX, and it's really quite simple when you look at it.

[edited by - Fuzztrek on March 30, 2004 3:15:59 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i think what he means is the creating the window part that should be wrapped, i was thinking of doing it for my project but i had lots of problems so i stoped for now

Share this post


Link to post
Share on other sites
well ive made my own if you want to rip code, its pretty clean and layed out,

..but hasnt got any error catching which is ok as long as you don't enter the wrong values or mind the program crashing when you do

http://users.bigpond.net.au/andrews/alib.h

edit:
excuse those 'friend class' calls, they arn't meant for anything, just old code i forgot to remove

[edited by - johnnyBravo on March 31, 2004 12:58:56 PM]

[edited by - johnnyBravo on March 31, 2004 1:01:07 PM]

Share this post


Link to post
Share on other sites