Jump to content
  • Advertisement
Sign in to follow this  
irlanrobson

OpenGL Mesh-Buffer Interaction

This topic is 1669 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'm confused with the design of my Structs/Classes. I have a GLContext with the OpenGL functions.
 
GLMB: GL Mesh Buffer
 
Question: the Mesh must be a Class (with functions to GenBuffers, Delete, etc.)?
 
Do I have to extend another class called GLMesh with VAOs and VBOs?

struct Vertex {
Vector3 p;
Vector2 uv; 
Vector3 n;
};


struct Mesh {
vector<Vertex> vertices;
vector<int> indices;


GLMB* glmb;
};


struct Material {
Vector3 a;
Vector3 d;
Vector3 s;
Vector3 e;


GLuint* texname;
};

struct Light {
Vector3 a;
Vector3 d;
Vector3 s;
Vector3 p;
};


struct Model {
Mesh mesh;
Material material;
};
Edited by irlanrobson

Share this post


Link to post
Share on other sites
Advertisement
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!