Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

105 Neutral

About kennycastro007

  • Rank

Personal Information

  • Interests
  1. kennycastro007

    glDrawElements isn't drawing anything

    I changed the code for that soon after I posted this, and the updated code is posted in the thread already
  2. kennycastro007

    glDrawElements isn't drawing anything

    Alright, thanks for telling me about the errors staying until glGetError is called, and that helped me isolate the cause of the 1280 error but turns out it still doesn't solve my error. I've checked after I fixed that error and there are no more errors, at least no more that are called by glGetError, the program still doesn't display anything to the screen. Also, I actually didn't vote your post down, I was the one who voted it up, when I checked it was already voted down, so I voted it back up :P
  3. kennycastro007

    glDrawElements isn't drawing anything

    Thanks for the information about the last parameter being either a buffer or a buffer offset, but even with that, the error still occurs.   void Mesh::Draw() { glBindVertexArray(vao);   //glDrawArrays(GL_TRIANGLES, 0, 6); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo);   glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, NULL);   GLenum error = glGetError(); std::cout << error << std::endl;   glBindVertexArray(0); }   and that gets called in the main loop of this function, and I've already isolated it to be a problem with glDrawElements, or at least everything works fine until its called. Also, by the first frame, I mean the first time this function gets called in the main loop. Since the error code is being outputted to the console, I was able to see the that the 1280 error only came up in the first call of this function
  4. kennycastro007

    glDrawElements isn't drawing anything

    I'm aware that the same parameters can't be sent through both functions, what I mean by "replace" is that I commented out glDrawArrays then I called glDrawElements glDrawArrays(GL_TRIANGLES, 0, 6); glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, m_elements);     m_elements is just a GLuint pointer to the indices array. Also, thanks for taking the time to help me with this little "bug" of mine   Also glGetError returns 1280 on the very first frame but then 0 on every other frame. This gets returned whether or not glDrawArrays or glDrawElements is drawn and also shows up whether or not something gets drawn to the screen
  5. Whenever I try to draw a mesh using glDrawElements, my program gets no errors, but it doesn't draw anything. I'm pretty sure that the issue is with glDrawElements since if I comment glDrawElements out and replace it with glDrawArrays, it works perfectly. So, my question is, can anyone help me figure out why this is happening?
  6. kennycastro007

    OpenGL Texture issues

    I've been having a very weird problem with my textures in my project. What's happening is that the pixels that my shaders are choosing to place on my object are dependent on where the object is in my window. When I have the object stationary on the screen I don't notice it, but once I start moving the object around the screen via glBufferSubData, I notice that the texture starts changing. Does anyone have any Idea of why this is happening? The whole texture won't bind completely onto the object either, I always end up getting only part of the image onto the object?
  7. I've been trying to make a 2d platformer, and I can't figure out how to make the player move when a key is pressed. Can anyone provide either a way to do this, or a link to a page that says how to? (I'm using modern opengl and I don't wan't to use an external library for this, as I am trying to get practice with OpenGL)
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!