Skip to main content
added 101 characters in body
Source Link
simulate
  • 145
  • 10

Okay its fixed now, but i dont know why. I played around and started copying the rendering in the loading function and then i called the loading function every frame (together with my other rendering function). i got 2 cubes, which had me wondering because i expected one (from the loadMesh function). when i erased the rendering part from the loadMesh function the one cube from the render() function stayed there! i dont know what happened, but it just works now. it might be because i called

    glEnableVertexArrayAttrib(vaoID, 0); 
    glEnableVertexArrayAttrib(vaoID, 1); 

when i copied the rendering part but i am not calling it anymore now and it still works! really weird.

EDIT: it looks like i HAVE to use glCreateBuffers instead of glGenBuffers. that was literally it.

Okay its fixed now, but i dont know why. I played around and started copying the rendering in the loading function and then i called the loading function every frame (together with my other rendering function). i got 2 cubes, which had me wondering because i expected one (from the loadMesh function). when i erased the rendering part from the loadMesh function the one cube from the render() function stayed there! i dont know what happened, but it just works now. it might be because i called

    glEnableVertexArrayAttrib(vaoID, 0); 
    glEnableVertexArrayAttrib(vaoID, 1); 

when i copied the rendering part but i am not calling it anymore now and it still works! really weird.

Okay its fixed now, but i dont know why. I played around and started copying the rendering in the loading function and then i called the loading function every frame (together with my other rendering function). i got 2 cubes, which had me wondering because i expected one (from the loadMesh function). when i erased the rendering part from the loadMesh function the one cube from the render() function stayed there! i dont know what happened, but it just works now. it might be because i called

    glEnableVertexArrayAttrib(vaoID, 0); 
    glEnableVertexArrayAttrib(vaoID, 1); 

when i copied the rendering part but i am not calling it anymore now and it still works! really weird.

EDIT: it looks like i HAVE to use glCreateBuffers instead of glGenBuffers. that was literally it.

Source Link
simulate
  • 145
  • 10

Okay its fixed now, but i dont know why. I played around and started copying the rendering in the loading function and then i called the loading function every frame (together with my other rendering function). i got 2 cubes, which had me wondering because i expected one (from the loadMesh function). when i erased the rendering part from the loadMesh function the one cube from the render() function stayed there! i dont know what happened, but it just works now. it might be because i called

    glEnableVertexArrayAttrib(vaoID, 0); 
    glEnableVertexArrayAttrib(vaoID, 1); 

when i copied the rendering part but i am not calling it anymore now and it still works! really weird.