[ create a new paste ] login | about

Link: http://codepad.org/Zwh9E3qi    [ raw code | output | fork ]

C++, pasted on Dec 28:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void Draw()
{
    // Turn on OpenGL texturing.
    glEnable(GL_TEXTURE_2D);

    // Activate a texture.
    glBindTexture(GL_TEXTURE_2D, m_Texture[0]); 

    // Map the texture onto a square polygon.
    glBegin(GL_POLYGON);
    glTexCoord2f(0.0, 0.0); glVertex3f(m_CenterX - m_Width, m_CenterY - m_Height, 0.0);
    glTexCoord2f(1.0, 0.0); glVertex3f(m_CenterX + m_Width, m_CenterY - m_Height, 0.0);
    glTexCoord2f(1.0, 1.0); glVertex3f(m_CenterX + m_Width, m_CenterY + m_Height, 0.0);
    glTexCoord2f(0.0, 1.0); glVertex3f(m_CenterX - m_Width, m_CenterY + m_Height, 0.0);
    glEnd();
}


Output:
1
2
3
In function 'void Draw()':
Line 4: error: 'GL_TEXTURE_2D' was not declared in this scope
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: