Module 7 Flashcards

1
Q

Is an OpenGL feature that provides methods for uploading vertex data to the video device for rendering

A

Vertex Buffer Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Provides substantial performance as data resides in the video device memory rather than the system memory.

A

Vertex Buffer Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What OpenGL constant is used to Bind a regular array data to the VBO
Group of answer choices

GL_VERTEX_ARRAY

GL_NORMAL_ARRAY

GL_ELEMENT_ARRAY_BUFFER

GL_ARRAY_BUFFER

A

GL_ARRAY_BUFFER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Complete the program below by copy and pasting the appropriate statements below to its right place.

glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat)*9, trianglevertices, GL_DYNAMIC_DRAW);
glClear(GL_COLOR_BUFFER_BIT);
glUnmapBuffer(GL_ARRAY_BUFFER);
glDrawArrays(GL_TRIANGLES,0,6);
glutTimerFunc(1000,modifyTriangle,0);
glVertexPointer(3, GL_FLOAT, 0, 0);
mappedVertices = (GLfloat *) glMapBuffer(GL_ARRAY_BUFFER, GL_READ_WRITE);

Consider the program below wherein the display function is used on the display callback of GLUT. The program moves the triangle

void display(){

    glColor4f(.16f,.72f,.08f,1.0f);

    triangle();

    glFlush();

}

void modifyTriangle(int value){

           triangleUpdate=true;

          

           

          

           mappedVertices[]+=.01f; //0

           mappedVertices[]+=.01f; //3

           mappedVertices[]+=.01f; //6

          

          

           glutPostRedisplay();

}

void triangle(){

    if(!triangleUpdate) {

                           GLfloat trianglevertices[] = {

                    0.0f, .75f, 0.0f,

                    -0.75f, 0.0f, 0.0f,

                    0.75f, 0.0f, 0.0f

            };

                           

            glGenBuffers(1, &VBOid);

            glBindBuffer(GL_ARRAY_BUFFER, VBOid);

            
  

 

            glEnableClientState(GL_VERTEX_ARRAY);

            glVertexPointer(3, GL_FLOAT, 0, 0);

            
   

    }else{

               //When for update just draw the primitive object

           

           glDrawArrays(GL_TRIANGLES,0,6);

    }

}

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Since we will be using some advance functions of OpenGL we will be needing ________ to simplify access to extended OpenGL extensions.

A

GLEW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Copy ___________ where your project source code resides.

A

glew.cand glew32.dll (x64)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Include __________ in your project directory

A

glew.c

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

GlGenBuffers parameters

A

Glsizei n
Gluint* buffers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

obtains n buffer identifiers from its pool of unused buffers

A

Glsizei n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

n is the number of buffer idenifiers desired by the application

A

Gluint buffers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

vertex array data

A

GL_ARRAY_BUFFER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

vertex array indices

A

GL_ELEMENT_ARRAY_BUFFER

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

uploads all the array information to the graphics card memory.

A

glBufferData()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The data store contents will be modified once and used at most a few times.

A

GL_STREAM_DRAW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The data store contents will be modified once and used many times.

A

GL_STATIC_DRAW

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The data store contents will be modified repeatedly and used many times.

A

GL_DYNAMIC_DRAW

17
Q

Activate and specify pointer to vertex array

A

glEnableClientState(GL_VERTEX_ARRAY);

18
Q

Include glew initialization calls before the

19
Q

Map the buffer object into the client’s memory

A

glMapBuffer(GLenumtarget, GLenumaccess)

20
Q

If GPU is still working with the buffer object, glMapBuffer() will not return until GPU finishes its job

21
Q

After modifying the data of VBO, it must be unmapped the buffer object from the client’s memory

22
Q

Using regular arrays is more efficient than VBO as it does not need to travel from physical memory to server memory.

23
Q

in creating VBO we first create an array to be transferred to the systems memory.
Group of answer choices

True

False

24
Q

What function is used for the initialization of OpenGL extensions.

A

glewInit()

25
To deallocate the buffer we use glDeleteBuff() function: Group of answer choices True False
False
26
Using VBOs are straightforward as they are included in the GLUT library. Group of answer choices True False
False
27
To switch back to normal operation we bind the buffer with a value of ___________. Group of answer choices 0 2 1 3
0