Jump to content
  • Advertisement
Sign in to follow this  
il_maestro

A good Direct3D Wrapper

This topic is 4896 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

Hi everyone. There is someone that can point me a good class/library with a Direct3D Wrapper? I need only a well done Direct3D and Device setup. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Err.. You can make one in about 3-5 minutes. Depends how fast you copy-paste.
Here's an example:


#ifndef 260505_D3DWRAP
#define 260505_D3DWRAP

#pragma comment(lib, "d3d9.lib");
#include <d3d9.h>


class D3DWRAP
{
private:
LPDIRECT3D9 d3d;
LPDIRECT3DDEVICE9 device;

public:
D3DWRAP() : d3d(NULL), device(NULL) {}
~D3DWRAP() { Destroy(); }

HRESULT Init()
{
// Copy-paste init code here.
return S_OK;
}

VOID Destroy()
{
if(d3d) d3d->Release();
if(device) device->Release();

d3d = NULL;
device = NULL;
}

LPDIRECT3DDEVICE9 GetDevice()
{
return this->device;
}
};


#endif



Wow that was fast.

Share this post


Link to post
Share on other sites
Yes, but i'm looking for something managing the parameters about the device creation.
Look here .
After some problems i had, i'm doubting of my own sight...so some tesed code is what i'm looking.

Share this post


Link to post
Share on other sites
^^^ What they said.

I would like to be the voice of the annoying teacher that tells you to "read the book too, my lectures aren't enough on their own."

Just pasting the code and knowing "it works" isn't good enough. If you plan on really having a quality engine or any chance of making in the professional world, you really need to know what is going on, and what each parameter means.

Anyway, you gotta start somewhere. I'm just saying to eventually take the time to learn what everything does!

-dbh

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!