Forums - eglCreateWindowSurface

8 posts / 0 new
Last post
eglCreateWindowSurface
adragos
Join Date: 16 Jun 14
Posts: 6
Posted: Wed, 2015-01-21 06:57

Hi,

I'm using Adreno SDK 3.6 on Windows 7.

I want to render stuff on two different native windows, so I call eglCreateWindowSurface twice, with the same parameters except for the NativeWindowType parameters:

 

EGLDisplay eglDisplay = ...;

EGLConfig config = ...;

HWND hWnd1 = CreateWindow(..);

NativeWindowType nativeWindow1 = (NativeWindowType)hWnd1;

EGLSurface eglSurface1 = eglCreateWindowSurface(eglDisplay, config, nativeWindow1, NULL);

HWND hWnd2 = CreateWindow(..);

NativeWindowType nativeWindow2 = (NativeWindowType)hWnd2;

EGLSurface eglSurface2 = eglCreateWindowSurface(eglDisplay, config, nativeWindow2, NULL);

 

I expected  eglCreateWindowSurface to return different surface values for different nativeWindow values, but it does not, so all my drawing is done in only one window.

Can you tell me if I'm doing something wrong?

 

 

  • Up0
  • Down0
carrado.grant@g...
Join Date: 20 Sep 12
Posts: 38
Posted: Wed, 2015-01-21 08:08

Creating the surface does not being its actually going to get rendered into...the process is exactly how you explained it..ie. you created a surface. Are you associating the said surface with the OpenGL context ? ( I'm assuming you are using OpenGL ). If not, how do you expect to render into the surface ?

  • Up0
  • Down0
adragos
Join Date: 16 Jun 14
Posts: 6
Posted: Wed, 2015-01-21 08:38

Yes, I'm using OpenGL ES 3.0 and I'm creating the context, but if those two variables for surfaces have the same value, then all drawing will be done in one window.

I've tried this with one context, making it current for each surface before drawing. If I try to create two contexts, one for each surface, with the first one being share_context for the second one, I get an assertion mesage:

File: ..\..\src\EGLEntry.cpp

Line: 502

Expression: err != EGL_BAD_CONTEXT

  • Up0
  • Down0
carrado.grant@g...
Join Date: 20 Sep 12
Posts: 38
Posted: Wed, 2015-01-21 10:09

Ok.now it make sense..if both handle refer to the same surface. So maybe there is a limitation in the SDK restricting you to only one window surface. Do you mind me asking about your exact use  case ? Does your application required multiple windows or are you just looking for another surface to render to that is not the primary surface ?

 

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Wed, 2015-01-21 14:35

Unfortunately the emulator in the Adreno SDK does not support more than 1 context, so this will be possible to test.

  • Up0
  • Down0
adragos
Join Date: 16 Jun 14
Posts: 6
Posted: Wed, 2015-01-21 23:44

@[email protected]

I'm working on a visual interface for a "shader editor" that allows loading a model and observe how changes made to it's shaders using this interface affects the model. For DirectX we're using swap chains and I'm looking for a way to make this work with OpenGL.
 

  • Up0
  • Down0
adragos
Join Date: 16 Jun 14
Posts: 6
Posted: Wed, 2015-01-21 23:48

@mhfeldma

That's not a big deal, one context would be enough (as I already posted). The real problem is that it doesn't seem to support more than one surface...

  • Up0
  • Down0
carrado.grant@g...
Join Date: 20 Sep 12
Posts: 38
Posted: Thu, 2015-01-22 07:35

Thanks for the description. If this is not going to be on a mobile device, then I would suggest using regular desktop GL. If it is for mobile, you could use viewports and scissoring to accomplish the multi-window effect.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.