Move & resize SDL_NOBORDER windows

There is a portable way to move & resize in response to mouse actions a
window opened with SDL_NOBORDER?

The only way I know is to get the os specific window pointer and to use
the appropriate OS api, am I wrong?

Bye,
Gabry

Gabriele Greco wrote:

There is a portable way to move & resize in response to mouse actions a
window opened with SDL_NOBORDER?

Obviously here I intended SDL_NOFRAME :slight_smile:

Bye,
Gabry

There is a portable way to move & resize in response to mouse actions a
window opened with SDL_NOBORDER?

The only way I know is to get the os specific window pointer and to use
the appropriate OS api, am I wrong?

Nope, that’s the only way.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

The only way I know is to get the os specific window pointer and to use
the appropriate OS api, am I wrong?
Nope, that’s the only way.

It’s something like an SDL_MoveWindow() or SDL_WM_MoveWindow() planned
for the v2 API?

I think it would be quite useful :slight_smile:

Anyway I’ll use the usual, ugly, approach with SDL_WM_GetInfo() and a
few #ifdef. :slight_smile:

Bye,
Gabry

The only way I know is to get the os specific window pointer and to use
the appropriate OS api, am I wrong?
Nope, that’s the only way.

It’s something like an SDL_MoveWindow() or SDL_WM_MoveWindow() planned
for the v2 API?

Yes, but I’m not sure how to gracefully blend the idea of windows v.s.
fullscreen viewports. There’s a whole mess of functionality involved
with a windowing system that just isn’t relevant when drawing to a
normal framebuffer.

Anyway I’ll use the usual, ugly, approach with SDL_WM_GetInfo() and a
few #ifdef. :slight_smile:

Sounds good. :slight_smile:

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Hello Sam,

I built SDL application with audio support (.ogg) in Windows by VC++
6.0. I use SDL 1.2.3.
The application works fine with music playing.
Anyway, after some time it hangs and does not respond, but the music still
plays. It seems that the application goes in an
infinite loop in audio thread. But why audio thread hangs the
application working thread? How can I solve it?

When I pause the application in debug mode I see this:

In Call Stack:
SDL_RunThread
SDL_RunAudio
DX5_WaitAudio_BusyWait (Line 278)
SDL_Delay(10)

And the place in DX5_WaitAudio_BusyWait() on line 278:

static void DX5_WaitAudio_BusyWait(_THIS)
{
DWORD status;
DWORD cursor, junk;
HRESULT result;

    /* Semi-busy wait, since we have no way of getting play notification
       on a primary mixing buffer located in hardware (DirectX 5.0)
    */
    result = IDirectSoundBuffer_GetCurrentPosition(mixbuf, &cursor, &junk);
    if ( result != DS_OK ) {
            if ( result == DSERR_BUFFERLOST ) {
                    IDirectSoundBuffer_Restore(mixbuf);
            }

#ifdef DEBUG_SOUND
SetDSerror(“DirectSound GetCurrentPosition”, result);
#endif
return;
}
cursor /= mixlen;

    while ( cursor == playing ) {
            /* FIXME: find out how much time is left and sleep that long */
            SDL_Delay(10); /// <<<< infinite loop

            /* Try to restore a lost sound buffer */
            IDirectSoundBuffer_GetStatus(mixbuf, &status);
            if ( (status&DSBSTATUS_BUFFERLOST) ) {
                    IDirectSoundBuffer_Restore(mixbuf);
                    IDirectSoundBuffer_GetStatus(mixbuf, &status);
                    if ( (status&DSBSTATUS_BUFFERLOST) ) {
                            break;
                    }
            }
            if ( ! (status&DSBSTATUS_PLAYING) ) {
                    result = IDirectSoundBuffer_Play(mixbuf, 0, 0, DSBPLAY_LOOPING);
                    if ( result == DS_OK ) {
                            continue;
                    }

#ifdef DEBUG_SOUND
SetDSerror(“DirectSound Play”, result);
#endif
return;
}

            /* Find out where we are playing */
            result = IDirectSoundBuffer_GetCurrentPosition(mixbuf,
                                                            &cursor, &junk);
            if ( result != DS_OK ) {
                    SetDSerror("DirectSound GetCurrentPosition", result);
                    return;
            }
            cursor /= mixlen;
    }

}

Thank you very much in advance!–
Best regards,
Alexander mailto:Editor at echo.ru

Hello,

I built SDL application with audio support (.ogg) in Windows by VC++
6.0. I use SDL 1.2.3.
The application works fine with music playing.
Anyway, after some time it hangs and does not respond, but the music still
plays. It seems that the application goes in an
infinite loop in audio thread. But why audio thread hangs the
application working thread? How can I solve it?

When I pause the application in debug mode I see this:

In Call Stack:
SDL_RunThread
SDL_RunAudio
DX5_WaitAudio_BusyWait (Line 278)
SDL_Delay(10)

And the place in DX5_WaitAudio_BusyWait() on line 278:

static void DX5_WaitAudio_BusyWait(_THIS)
{
DWORD status;
DWORD cursor, junk;
HRESULT result;

    /* Semi-busy wait, since we have no way of getting play notification
       on a primary mixing buffer located in hardware (DirectX 5.0)
    */
    result = IDirectSoundBuffer_GetCurrentPosition(mixbuf, &cursor, &junk);
    if ( result != DS_OK ) {
            if ( result == DSERR_BUFFERLOST ) {
                    IDirectSoundBuffer_Restore(mixbuf);
            }

#ifdef DEBUG_SOUND
SetDSerror(“DirectSound GetCurrentPosition”, result);
#endif
return;
}
cursor /= mixlen;

    while ( cursor == playing ) {
            /* FIXME: find out how much time is left and sleep that long */
            SDL_Delay(10); /// <<<< infinite loop

            /* Try to restore a lost sound buffer */
            IDirectSoundBuffer_GetStatus(mixbuf, &status);
            if ( (status&DSBSTATUS_BUFFERLOST) ) {
                    IDirectSoundBuffer_Restore(mixbuf);
                    IDirectSoundBuffer_GetStatus(mixbuf, &status);
                    if ( (status&DSBSTATUS_BUFFERLOST) ) {
                            break;
                    }
            }
            if ( ! (status&DSBSTATUS_PLAYING) ) {
                    result = IDirectSoundBuffer_Play(mixbuf, 0, 0, DSBPLAY_LOOPING);
                    if ( result == DS_OK ) {
                            continue;
                    }

#ifdef DEBUG_SOUND
SetDSerror(“DirectSound Play”, result);
#endif
return;
}

            /* Find out where we are playing */
            result = IDirectSoundBuffer_GetCurrentPosition(mixbuf,
                                                            &cursor, &junk);
            if ( result != DS_OK ) {
                    SetDSerror("DirectSound GetCurrentPosition", result);
                    return;
            }
            cursor /= mixlen;
    }

}

Thank you very much in advance!–
Best regards,
Alexander mailto:Editor at echo.ru


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl