Results 1 to 6 of 6

Thread: How can i run this OPENGL ES program

  1. #1
    Junior Member
    Join Date
    May 2004
    Location
    Pakistan
    Posts
    3

    How can i run this OPENGL ES program

    Hi

    I am trying to compile a program available on this link
    http://www.khronos.org/opengles/docu.../eglIntro.html

    but i m missing #include <unistd.h>
    and there is one more compilation error at
    typedef ... NativeWindowType;

    and if i ignore these two lines i get so many linking error

    please help me.............. x()

    here is the code

    #include <stdlib.h>
    #include <unistd.h>
    #include <GLES/egl.h>
    #include <GLES/gl.h>

    typedef ... NativeWindowType;
    extern NativeWindowType createNativeWindow(void);

    static EGLint const attribute_list[] = {
    EGL_RED_SIZE, 1,
    EGL_GREEN_SIZE, 1,
    EGL_BLUE_SIZE, 1,
    EGL_NONE
    };

    int main(int argc, char ** argv)
    {
    EGLDisplay display;
    EGLConfig config;
    EGLContext context;
    EGLSurface surface;
    NativeWindowType native_window;
    EGLint num_config;

    /* get an EGL display connection */
    display = eglGetDisplay(EGL_DEFAULT_DISPLAY);

    /* initialize the EGL display connection */
    eglInitialize(display, NULL, NULL);

    /* get an appropriate EGL frame buffer configuration */
    eglChooseConfig(display, attribute_list, &config, 1, &num_config);

    /* create an EGL rendering context */
    context = eglCreateContext(display, config, EGL_NO_CONTEXT, NULL);

    /* create a native window */
    native_window = createNativeWindow();

    /* create an EGL window surface */
    surface = eglCreateWindowSurface(display, config, native_window, NULL);

    /* connect the context to the surface */
    eglMakeCurrent(display, surface, surface, context);

    /* clear the color buffer */
    glClearColor(1.0, 1.0, 0.0, 1.0);
    glClear(GL_COLOR_BUFFER_BIT);
    glFlush();

    eglSwapBuffers(display, surface);

    sleep(10);

    return EXIT_SUCCESS;
    }


  2. #2
    Senior Member
    Join Date
    Sep 2003
    Location
    Seattle, WA
    Posts
    246

    Re: How can i run this OPENGL ES program

    What platform and OpenGL ES implementation are you using?

  3. #3
    Junior Member
    Join Date
    May 2004
    Location
    Pakistan
    Posts
    3

    Re: How can i run this OPENGL ES program

    I am using Windows 2000 and Visual C++ 6.0
    and i have downloaded EGL.h and gl.h from http://www.khronos.org
    what does mean by *OpenGL ES Implementation* sorry i am very new in OPENGL ES programming.

    Thanks

  4. #4
    Senior Member
    Join Date
    Sep 2003
    Location
    Seattle, WA
    Posts
    246

    Re: How can i run this OPENGL ES program

    I see. To many questions to be answered here.

    Try this.

    - HM

  5. #5

    Re: How can i run this OPENGL ES program

    Hi sohrab.

    Those typedefs for Native EGL types (such as EGLNativeWindow) should be defined in the platform-dependent header file and should not be defined in your own program code.

    Have you tried downloading the OpenGL ES sample implementation from the Khronos site ?
    http://www.khronos.org/opengles/tutorials_code/.

    It should compile with Visual C also and you should be able to experiment OpenGL ES programming with it. You can start writing (& testing) your code with it and then move to using the real SDK for the embedded device that you are targeting (when these are available).

    --jani;

    [ August 05, 2005, 04:24 PM: Message edited by: Boardmaster ]

  6. #6
    Junior Member
    Join Date
    May 2004
    Location
    Pakistan
    Posts
    3

    Re: How can i run this OPENGL ES program

    Hi

    Thanks to all of you , yes i am able to compile and run the program that Jani refer to me , and now i am start getting the things
    once again thanks for giving me start

    Regards

Similar Threads

  1. Program run on CPU with 2 core....
    By jai in forum OpenCL
    Replies: 3
    Last Post: 10-08-2012, 08:58 PM
  2. I can't seem to get your program to run in Chrome.
    By Agamemnon in forum User Hardware, Software Help
    Replies: 1
    Last Post: 01-19-2012, 12:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •