Results 1 to 4 of 4

Thread: How can i isolate Opengl code from my view class?

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Location
    Bavaria Germany
    Posts
    12

    How can i isolate Opengl code from my view class?

    Hello everybody,

    i have tried to isolate some methods and OpenGL ES calls to some normal c++ classes. But they doesn't work. The same code works when i use it in the Objective C class with the context. How can i solve this problem? I like to make a little wrapper class with the context and the view because i like to make the same code on Android.

    Can someone explain how to isolate the whole methods and OpenGL calls?

    Greets
    krikit.

  2. #2
    Junior Member
    Join Date
    Mar 2012
    Location
    Bavaria Germany
    Posts
    12

    Re: How can i isolate Opengl code from my view class?

    Hello,

    i have solved the problem.

    It seems that in OpenGL ES a GLuint variable isn't the same like a casted variable.

    So the following code snippet shows the differences.
    Code :
    GLuint i = 20;
    int j = 20;
    glReadPixels(0, 0, i, (GLuint)j, GL_RGBA, GL_UNSIGNED_BYTE, pictureDest);

    best regards
    krikit

  3. #3
    Junior Member
    Join Date
    Jul 2011
    Posts
    17

    Re: How can i isolate Opengl code from my view class?

    Quote Originally Posted by krikit
    Hello,

    i have solved the problem.

    It seems that in OpenGL ES a GLuint variable isn't the same like a casted variable.

    So the following code snippet shows the differences.
    Code :
    GLuint i = 20;
    int j = 20;
    glReadPixels(0, 0, i, (GLuint)j, GL_RGBA, GL_UNSIGNED_BYTE, pictureDest);

    best regards
    krikit
    The GLuint is an unsigned int, thus unsigned int j would work. Although some compilers only give warnings and some gives errors

  4. #4
    Junior Member
    Join Date
    Mar 2012
    Location
    Bavaria Germany
    Posts
    12

    Re: How can i isolate Opengl code from my view class?

    Hi,

    thanks! It's right i didn't use an unsigned int. I use the gcc compiler under iOS and it doesn't give me a warning. So i didn't find the solution for a while ^^ and it takes a lot of time to figure it out.

Similar Threads

  1. Trying to get an OpenGL view in an IPhone app
    By Stoff81 in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 12-21-2008, 02:49 AM
  2. OpenGL ES and View Arch. in Series 60
    By Fadi Chehimi in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 06-15-2005, 11:11 AM

Posting Permissions

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