Results 1 to 3 of 3

Thread: glGenTextures and Java

  1. #1
    Banned
    Join Date
    Aug 2018
    Posts
    1

    glGenTextures and Java

    Hi,

    I don't suppose there's a way to get around having to call

    eglCreateWindowSurface

    and

    eglMakeCurrent

    before making any calls to

    glGenTextures

    in the Java implementation of OpenGLES is there? The main problem is that at the time I come to create the textures (loading scene graph from file) I don't yet have access to the Graphics object being used (it's a cross platform API... long story) and so I need to create the glTextures, but at this point have no Graphics object to use with eglCreateWindowSurface, to then use with eglMakeCurrent. So I'm getting an IllegalStateException with "no current context". Is it possible to create an "empty" context to make these calls with?
    Basically I don't understand exactly why the Graphics object needs to be known at this point, I'm a little fuzzy on the ties between these function calls and the context. Are all textures created with a certain context set current only usable when that context is set current?

    Er.. ta in advance. And if it sounds like I don't know what the chuff I'm talking about that's probably true.

  2. #2
    Junior Member
    Join Date
    Jun 2010
    Posts
    22
    Quote Originally Posted by sage12 View Post
    The main problem is that at the time I come to create the textures ...
    I need to create the glTextures, but at this point have no Graphics object to use with eglCreateWindowSurface, to then use with eglMakeCurrent.

    Is it possible to create an "empty" context to make these calls with?
    If you don't have a graphics context, you don't need to create the GL textures yet (they're the GPU-side representation of the texture data). Just packrat the texture data in CPU memory, and create the GL textures later when you have a graphics context.

    There is this extension: EGL_KHR_surfaceless_context. But you probably don't need this, even if your platform supports it.

    Basically I don't understand exactly why the Graphics object needs to be known at this point, ...
    Are all textures created with a certain context set current only usable when that context is set current?
    A graphics context is your "window" to the GPU driver and the GPU. You need that to create resources in the GPU driver or on the GPU.

  3. #3
    Administrator khronos's Avatar
    Join Date
    Jun 2002
    Location
    Montreal
    Posts
    103
    Suspect this is a bot post. Original here: https://forums.khronos.org/showthrea...nTextures+Java

    Closing this thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean