Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 939931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:52:21+00:00 2026-05-15T21:52:21+00:00

I tried to use this tutorial http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=45 I load it in my visual studio

  • 0

I tried to use this tutorial
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=45

I load it in my visual studio 2008, compile it, and it says missing file: “GLES/glplatform.h” so i google the file… then it whines missing file: “KHR/khrplatform.h”, so i google that too… then it whines everything possible, “GLDouble undeclared identifier” etc etc, even though that tutorial has #include which should have those.

I dont know where to start fixing this, could someone just give me code how to use VBO properly (draw a cube etc), every code i have tried just crashes or wont compile. i cant find anything that works.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:52:21+00:00Added an answer on May 15, 2026 at 9:52 pm

    ok so let’s start with what you should check for. In your compiler look for gl.h . If you won’t find it download Windows SDK. If you are using Visual Studio good for you, if not take just the OpenGL files. I suggest you full SDK because I haven’t yet found gl.h separatelly, probably because everybody has it.. As for the SDK, in Windows Server 2003 R2 Platform SDK these openGL files are for sure, but you should try first Windows 7/Vista SDK.

    Now. You mentioned GLES. I don’t know how GLES work because I use GLEW. In many ways NeHe wrote great tutorials but they’re getting outdated. So if you like to continue with me, use GLEW. You will include it on start + you will have to provide library. Like this

    #include <GL/glew.h>
    #pragma comment(lib,"glew32.lib")
    

    Also you will have to copy glew32.dll to folder where your EXE is.

    Now you should be set up for creating VBO. I guess that you already learned how to create blank window if not here’s link. You will have to download GLUT(or better freeglut) if you didn’t already, but it is widely used and you will need it later on anyway.

    We’ll do some additions in that code. In main func, call init() under CreateWindow call like this

    glutCreateWindow ("Your first OpenGL Window");
    init();
    

    and make function init look like this:

    void init(){
        glewInit();
        glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
        glShadeModel(GL_FLAT);
        glEnableClientState(GL_VERTEX_ARRAY);
    }
    

    also make reshape() func:

    void reshape(int w, int h){
        glViewport(0,0, (GLsizei) w, (GLsizei) h);
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
        gluOrtho2D(0.0f, (GLdouble) w, 0.0f, (GLdouble) h);
    }
    

    and add this line under glutDisplayFunc(display);

    glutReshapeFunc(reshape);
    

    Now we are ready for VBO actually this was just trivial creating of window where we can see output but as you said you had some problems I better wrote it down, as for others.

    So how to use VBO if you want to see result now here’s code I’ll try to tell you about it:
    make global variable

    GLuint ID;
    

    before any of functions

    add this part on bottom of init() function:

    float data[][2] = {{50,50},{100,50},{75,100}};
    glGenBuffers(1,&ID);
    glBindBuffer(GL_ARRAY_BUFFER, ID);
    glBufferData(GL_ARRAY_BUFFER, sizeof(data), data, GL_STATIC_DRAW);
    

    and this part into display function which is empty in this moment:

    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(0.0f,0.0f,0.0f);
    glBindBuffer(GL_ARRAY_BUFFER, ID);
    glVertexPointer(2, GL_FLOAT, 2*sizeof(float), 0);
    glDrawArrays(GL_POLYGON,0,3);
    glFlush();
    

    You should see black triangle.
    So to the code. You make some sort of data.
    Then you generate new VBO ID which is not in use(will be 1 in our example everytime 🙂 ).
    After this with Bind call you actually create this VBO and with BufferData call you asign your data to that VBO. In display, you clear window for use, select drawing color and now the Bind means ACTIVATE this buffer object. You can have number of VBO in ARRAY_BUFFER but only one can be active. VertexPointer is use to set begining of VBO and strides between it’s elements. As you can see we used X and Y coordinates as elements so stride is 2*sizeof(float). That’s because stride is in bytes. Finnaly DrawArrays is render call, something as you would call glBegin() and glEnd(). You tell what to draw, and in which range. glFlush() is just used for showing rendered stuff.

    If you got lost somewhere in code here it is on one place:

    #include <windows.h>
    #include <iostream>
    #include <GL/glew.h>
    #include <GL/freeglut.h>
    
    #pragma comment(lib,"glew32.lib")
    
    GLuint ID;
    
    void init(){
        glewInit();
        glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
        glShadeModel(GL_FLAT);
        glEnableClientState(GL_VERTEX_ARRAY);
        float data[][2] = {{50,50},{100,50},{75,100}};
        glGenBuffers(1,&ID);
        glBindBuffer(GL_ARRAY_BUFFER, ID);
        glBufferData(GL_ARRAY_BUFFER, sizeof(data), data, GL_STATIC_DRAW);
    }
    
    void reshape(int w, int h){
        glViewport(0,0, (GLsizei) w, (GLsizei) h);
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
        gluOrtho2D(0.0f, (GLdouble) w, 0.0f, (GLdouble) h);
    }
    
    void display(){
        glClear(GL_COLOR_BUFFER_BIT);
        glColor3f(0.0f,0.0f,0.0f);
        glBindBuffer(GL_ARRAY_BUFFER, ID);
        glVertexPointer(2, GL_FLOAT, 2*sizeof(float), 0);
        glDrawArrays(GL_TRIANGLES,0,3);
        glFlush();  
    }
    
    int main(int argc, char **argv){
        glutInit(&argc,argv);
        glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
        glutInitWindowSize(500,500);
        glutInitWindowPosition(300,300);
        glutCreateWindow(argv[0]);
        init();
        glutDisplayFunc(display);
        glutReshapeFunc(reshape);
        glutMainLoop();
        return 0;
    }
    

    PS: I know this is month old question but I think all questions should be answered so anyone looking for same problem won’t get here and find nothing 😉

    PSS: If this example asks for DLL you have them in freeglut or GLEW bin files 😉

    Edit1: I forgot for that so don’t make same mistake, after you are finished with VBO destroy it to prevent memory leak. As VRAM isn’t so big this can be serious here’s how to do it:

    glDeleteBuffers(1, &ID);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to follow the tutorial for JSP Templates at: http://java.sun.com/developer/technicalArticles/javaserverpages/jsp_templates/ I am
I am trying to use simplemodal to have modal popups with text in wordpress
I see the following error in DDMS when trying to use a CheckBox on
I feel like this is probably a pretty dumb question, but I am just
I'm currently developing a percussion tutorial program. The program requires that I can determine
So, I'm trying to use tokens with Devise (version 1.0.3 with Rails 2.3.8) to
Hello all and thanks for the attention! I have a problem that must both
I am creating a website which is going to require up-to-date iPhone App prices,
I have what will become an 'external' activemq server I'd like grails to be
i have three simple images of a hen which i am trying to animate(hen

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.