Jump to content

  • Log In with Google      Sign In   
  • Create Account


PpenGlProg

Member Since 09 Jul 2013
Offline Last Active Aug 09 2013 11:42 PM
-----

Topics I've Started

glvertexpointer std::vector, struct memory opengl

17 July 2013 - 08:50 AM

Hello, i use struct


struct Vertex
{
float pos[3];
float tex[2] = {0, 0};
float norm[3] = {0, 0, 0};
int index_mtl;
};


i use vector

std::vector<Vertex> verts;

how use "glvertexpointer" for my struct vector.

I wanted to drawing by that function. in the end I did not succeed.


void Obj_render::DrawObject()
{
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, verts.data()->pos);

glDrawArrays(GL_TRIANGLES,0,3);
// deactivate vertex arrays after drawing
glDisableClientState(GL_VERTEX_ARRAY);

}
 


Properly implemented loader objects?

09 July 2013 - 07:04 AM

hello smile.png . I have implemented a loader object that all true I do?

 

I attached the source file.

 

 


PARTNERS