Skip to main content
gamedev.net
🔒 Locked

Vertex Processing engine

Started by BloodLust666 Apr 7, 2005 at 12:24 AM 4 replies 1k views
Original Post
BloodLust666
BloodLust666
i'm in a bit a of a writers block... i'm trying to make a class that able to handle all kinds of FVF formats. here's my class so far. class cVertexBuffer { protected: cGraphics* m_pGraphics; IDirect3DVertexBuffer9* m_pVB; DWORD m_FVF; public: cQuadTexture(); ~cQuadTexture(); Init(cGraphic *Graphic); }; is there any way i could have mb a function or inherite every vertex structor.. or somekthing... to be able to just have a setting set to something and have the class able to handle 2d color formats or 3d color normal formats
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
BloodLust666
BloodLust666
i think i kinda figured it out, but i just need to think of a way to be able to create vertexes and be able to keep track of them in that one class and be able to render them in one call or something
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
Promit
Promit
You really ought to work with vertex declarations instead of FVF. The SDK can tell you more.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Muhammad Haggag
Muhammad Haggag
As Promit says, going with vertex declarations is better. On another note, you shouldn't be writing a class that handles all FVFs - Don't do bottom-up design, do it top-down. If you're writing an engine, write small games (or samples) in the easiest and clearest way possible, and then write your engine to make the game/sample code compilable and runnable. That way, you don't end up writing a lot of stuff that you won't be using anyway.

It's worth noting that if your end-goal is to be a game-logic programmer, or to make a game without specifically being an engine programmer, choose an already-existing open or closed source engine and use it. OGRE and Irrlichit come to mind.

And don't worry, you'll be learning tons of fun and interesting stuff along the way. There's more to games than graphics [smile]

BloodLust666
BloodLust666
what do u mean vertex declaration? u mean the struct that holds the coordinates and what not??

Well, i am looking at a little engine, it's the one that came in the "Programming Role Playing Games with DirectX 2nd edition book" it's really good for those who love RPGs :)

In that engine, there is no vertex declaration and no struct to hold the coordinates of the vertexes, i don't know how they do it then, but yae, that's how they do it...

i want to be able to set the number of vertexes i want and spefic the coordinates for each and have a bool value to say whether it sould be rendered or not, then with one function, iw ant to be able to scrool through all vertexes and render them... any ideas?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
BloodLust666
BloodLust666
well... i think i thought of something. instead of having just ONE class which is probably impossible, whenever i need a new buffer to make a new object, i just make a new object of the class that looks like this.

class cQuadTexture
{
protected:
cGraphics* m_pGraphics;
IDirect3DVertexBuffer9* m_pVB;

DWORD m_FVF;
sVertexQuad *m_Vertex // Array

public:
cQuadTexture();
~cQuadTexture();

Init(cGraphics *Graphics);
};

struct sVertexQuad
{
long x, y, y, rhw;
long u, v;
}

(as of new the vertex buffer is going to be used for a 2d game
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.