Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
56 user(s) are online (46 user(s) are browsing Forums)

Members: 0
Guests: 56

more...

Headlines

 
  Register To Post
« 1 ... 14 15 16 (17)

Re: SDL1 open issues
Just can't stay away
Just can't stay away


See User information
@kas1e

Yes, it should be possible. You need the Intuition window pointer first. Then, call aglCreateContext and pass the window pointer. Now you should have a GL context which you can make current, draw, swap the buffers and destroy later (before window closing, probably). And in case window pointer changes it has to be refreshed.

There might be some conflicts if app calls SDL_Flip or similar. These probably should be deactivated.

Go to top
Re: SDL1 open issues
Home away from home
Home away from home


See User information
Ah so, we still need to create context by OGLES2, and SDL1 didn't create one for us as it happens with SDL2 ..

Did i understand right, that with SDL1, when we create a window with :

Screen SDL_SetVideoModeWidthHeightCreationParams.BitsSDL_Flags );


Where one of flags SDL_OPENGL; then we do create MiniGL context by the SDL1 source code.

But now, if we want to draw by ogles2 to sdl1 window, we should _not_ create window with SDL_OpenGL, so to avoid creating of MiniGL context, but instead, we create non-opengl window, and then get the intuition window pointer, and then aglCreateContext and then aglMakeCurrent ?


PS. Btw, how can i get Intuition window pointer from SDL_Surface *Screen ? I see we do have some SDL_PrivateVideoData field which store window pointer among others, but how to get it from screen created by SDL_SetVideoMode ? I.e. i have now:

LOGLES2 IExec->OpenLibrary("ogles2.library"0);
    if(!
LOGLES2) {
        
printf("LIBGL: Warning, cannot open ogles2 Library!\n");
        return;
    }
    
IOGLES2 = (struct OGLES2IFace *)IExec->GetInterface(LOGLES2"main"1NULL); 
    if(!
IOGLES2) {
        
printf("LIBGL: Warning, cannot openogles2 Interface!\n");
        
IExec->CloseLibrary(LOGLES2);
        
LOGLES2 NULL;
    }


..
blablablbal Init SDL without SDL_OpenGL flag to void minigl..

Screen SDL_SetVideoModeWidthHeightCreationParams.BitsSDL_Flags );

    
struct TagItem contextparams[] =
    {
            {
OGLES2_CCT_WINDOW,(ULONG)Screen->win},
            {
OGLES2_CCT_DEPTH,16},
            {
OGLES2_CCT_STENCIL,8},
            {
OGLES2_CCT_VSYNC,0},
            {
OGLES2_CCT_SINGLE_GET_ERROR_MODE,1},
            {
OGLES2_CCT_RESIZE_VIEWPORTTRUE},
            {
TAG_DONE,0}
    };
        
    
void *ogles_context IOGLES2->aglCreateContext2(&errCode,contextparams);

      if (
ogles_context)
    {
        
IOGLES2->aglMakeCurrent(ogles_context);
        
    }


And this "win" i not sure from where take. SDL_Surface structure seems do not contain it so it should be some private field or something , like maybe Screen->private_data->win ?


Edited by kas1e on 2022/9/22 13:54:34
Edited by kas1e on 2022/9/22 14:02:42
Go to top
Re: SDL1 open issues
Just can't stay away
Just can't stay away


See User information
@kas1e

You probably should skip SDL_OPENGL flag in this scenario.

Try using SDL_GetWMInfo() to get window pointer.

Go to top
Re: SDL1 open issues
Home away from home
Home away from home


See User information
@Capehill
Rigth, so i just did rigth before context-creation this:

SDL_SysWMinfo wmi = { };
    
SDL_GetWMInfo(&wmi);


And then: {OGLES2_CCT_WINDOW,(ULONG)wmi.window}, works.

I also while waiting your answer already tested by using the same hack which i did for GL4ES (so to open ogles2 context instead,etc) and this works too.

Throuhg, by "works" i mean, no crash, and i can see that shaders are about to be compiled, but, i still have black screen, few GLSL shader program failed to link and GL_INVALID_OPERATION 176.

I will create relevant topic about all this to not flood this one.

Go to top

  Register To Post
« 1 ... 14 15 16 (17)

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project