Sign in to follow this  
il_maestro

A good Direct3D Wrapper

Recommended Posts

il_maestro    100
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
Pipo DeClown    804
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
il_maestro    100
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
dbh    166
^^^ 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this