Questions tagged [vertex-array]
109 questions
0
votes
1 answer
Using glBindVertexArray in update loop in DSA code or not
I'm the process of converting some opengl code to DSA and everywhere its written not to bind the vertex array, because its inherit in DSA. So I use
GLuint VBO, VAO, indexBuffer;
glCreateVertexArrays(1, &VAO);
glCreateBuffers(1,…

Hans Micheelsen
- 19
- 1
- 2
- 10
0
votes
3 answers
VertexArray of circles
I am wondering if it is possible to create a VertexArray of circles in SFML. I have looked for answers but I didn't find anything that could help. Moreover, I don't understand the part on the SFML documentation where it is written that I can create…

Leop
- 75
- 7
0
votes
1 answer
How do you flip texture in VertexArray?
I have a spritesheet animation drawn using a vertexarray. As an example let's say I have an arrow pointing to the right with a simple animation. I would like to be able to flip the texture on the x axis so that the arrow can also point left without…

Nathaniel G.M.
- 433
- 5
- 15
0
votes
1 answer
Correct format for loading vertex arrays from file
I've been banging my head on my keyboard for the past couple of weeks over this. What I'm trying to do is load an array of floats (GLfloat) and an array of unsigned shorts (GLushort) from a text file into equivalent arrays in objective-c so that I…

Davido
- 2,913
- 24
- 38
0
votes
1 answer
OpenGL draw circle, weird bugs
I'm no mathematician, but I need to draw a filled in circle.
My approach was to use someone else's math to get all the points on the circumference of a circle, and turn them into a triangle fan.
I need the vertices in a vertex array, no immediate…

Prime
- 4,081
- 9
- 47
- 64
0
votes
3 answers
OpenGL ES: Do vertex structs need x, y, AND z?
This is probably a stupid question, but I've been wondering it - do vertex structs in OpenGL NEED to have x, y and z? I'm drawing in 2D, yet all the tutorials I've seen seem to have a z variable in their struct even though it's always 0. Doesn't…

MysteryPancake
- 1,365
- 1
- 18
- 47
0
votes
1 answer
OpenGL array handover do not work
I am trying to program some game with OpenGL and read a whole bunch of tutorials. Unfortunately I got a small problem who just interrupts my progress.
I created a "Mesh" class where I handover an array of GLfloats. These floats are included by an…

linux_lover
- 125
- 1
- 13
0
votes
2 answers
How to have multiple storage layouts in one Vertex Array Object?
When I say storage layout, I mean what I define with glVertexAttribPointer. Is this state saved in the currently bound VAO or the buffer I bound to GL_ARRAY_BUFFER?

mskr
- 375
- 5
- 14
0
votes
0 answers
OpenGL 4.3+ element arrays
I'm building my own game engine in C++14 with a core OpenGL 4.3 back-end.
I'm following the following tutorials:
http://www.learnopengl.com/
http://antongerdelan.net/opengl/
I also follow these books:
OpenGL SuperBible (Sixth Edition)
OpenGL 4…

cjdb
- 54
- 3
- 9
0
votes
1 answer
OPENGL: Square Class Using VBO
So, I am trying to make a basic "Drawable" class that handles a lot of the drawing for me in the background and I want to use modern OpenGL (no begin and end statements). I keep just getting a blank screen when I run draw().
I have run the debugger…

guitar80
- 716
- 6
- 19
0
votes
0 answers
Vertex Arrays with glDrawElements in jogl not rendering
I have tried following this and this to get vertex arrays from jogl to work and, although its not throwing any errors any more, it also isn't rendering anything but a blank screen. Here is the code:
public void init(GLAutoDrawable drawable) {
…
0
votes
2 answers
OpenGL texture coordinates being skewed when using vertex arrays
I have the following code to try to draw a rectangle using vertex arrays:
glEnableClientState( GL_NORMAL_ARRAY );
glNormalPointer( GL_FLOAT, 0, &mNorms[ 0 ] );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
glTexCoordPointer( 2, GL_FLOAT, 0,…

xpnctoc
- 63
- 8
0
votes
3 answers
OpenGL - Indexed Draws with glDrawElements
I have a couple questions about how OpenGL handles these drawing operations.
So lets say I pass OpenGL the pointer to my vertex array. Then I can call glDrawElements with an array of indexes. It will draw the requested shapes using those indexes in…

Klayton Curran
- 7
- 4
0
votes
1 answer
glDrawElements not working in the other machine
I'm using OpenGL with g++. This simple code works fine in my system. It draws a rectangle as expected.
GLfloat vertices[] =
{
0,0,0, //0
0,6,0, //1
6,6,0, //2
6,0,0, //3
};
GLint indices[] =…

Shashwat
- 2,538
- 7
- 37
- 56
0
votes
1 answer
Problems with Vertex Arrays
i'm trying to learn how to handle VBOs (VertexBufferObjects), but i can't get further than the Vertex Arrays. I followed some basic tutorials on this topic, each teaching a different way, making it hard for me to understand and implement.
Problem:…

Matze
- 533
- 7
- 16