What happened to SDL_SetVideoMode() in SDL2

Hi,

A simple test code is not building because there is not
SDL_SetVideoMode() and SDL_Flip() in SDL2.

What happened to them? Who replaced them?

In version 1.2.15

$arif at khost:~/sak/SDL$ global -x SDL_SetVideoMode
SDL_SetVideoMode 583 src/video/SDL_video.c SDL_Surface *
SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)

$arif at khost:~/sak/SDL$ global -x SDL_Flip
SDL_Flip 1105 src/video/SDL_video.c int SDL_Flip(SDL_Surface
*screen)

But in hg tip, there is nothing.

arif at khost:~/sak/tests$ gcc sdl_load_image.c pkg-config --cflags --libs sdl2
sdl_load_image.c: In function ?main?:
sdl_load_image.c:9:9: warning: assignment makes pointer from integer
without a cast [enabled by default]
/tmp/cc4ZEiir.o: In function main': sdl_load_image.c:(.text+0x43): undefined reference toSDL_SetVideoMode’
sdl_load_image.c:(.text+0x9e): undefined reference to `SDL_Flip’
collect2: ld returned 1 exit status

grepping them comes up with nothing

arif at khost:~/sak/SDL$ hg tip
changeset: 7306:1516fe08e6ec
tag: tip
user: Sam Lantinga
date: Tue Jun 11 08:37:03 2013 -0700
summary: Added an arbitrary limit to the number of queued events so
it doesn’t grow unbounded.–
Cheers
arif

In SDL 2 you need to create a window and a renderer. Check out the
headers and/or docs.

Regards,

Leszek

2013/6/12 arif :> Hi,

A simple test code is not building because there is not SDL_SetVideoMode()
and SDL_Flip() in SDL2.

What happened to them? Who replaced them?

In version 1.2.15

$arif at khost:~/sak/SDL$ global -x SDL_SetVideoMode
SDL_SetVideoMode 583 src/video/SDL_video.c SDL_Surface * SDL_SetVideoMode
(int width, int height, int bpp, Uint32 flags)

$arif at khost:~/sak/SDL$ global -x SDL_Flip
SDL_Flip 1105 src/video/SDL_video.c int SDL_Flip(SDL_Surface
*screen)

But in hg tip, there is nothing.

arif at khost:~/sak/tests$ gcc sdl_load_image.c pkg-config --cflags --libs sdl2
sdl_load_image.c: In function ?main?:
sdl_load_image.c:9:9: warning: assignment makes pointer from integer without
a cast [enabled by default]
/tmp/cc4ZEiir.o: In function main': sdl_load_image.c:(.text+0x43): undefined reference toSDL_SetVideoMode’
sdl_load_image.c:(.text+0x9e): undefined reference to `SDL_Flip’
collect2: ld returned 1 exit status

grepping them comes up with nothing

arif at khost:~/sak/SDL$ hg tip
changeset: 7306:1516fe08e6ec
tag: tip
user: Sam Lantinga
date: Tue Jun 11 08:37:03 2013 -0700
summary: Added an arbitrary limit to the number of queued events so it
doesn’t grow unbounded.


Cheers
arif


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

http://wiki.libsdl.org/moin.fcg/MigrationGuide
"You update the physical screen using SDL_RenderPresent
http://wiki.libsdl.org/moin.fcg/SDL_RenderPresent, which replaces
SDL_Flip and SDL_UpdateRects. "
"SDL_SetVideoMode from 1.2 is now just a compatibility function, you
will not use it anymore. You can use SDL_GetWindowSurface
http://wiki.libsdl.org/moin.fcg/SDL_GetWindowSurface to get a 1.2
style surface for a window if necessary. "On 6/12/2013 7:15 AM, arif wrote:

Hi,

A simple test code is not building because there is not
SDL_SetVideoMode() and SDL_Flip() in SDL2.

What happened to them? Who replaced them?

In version 1.2.15

$arif at khost:~/sak/SDL$ global -x SDL_SetVideoMode
SDL_SetVideoMode 583 src/video/SDL_video.c SDL_Surface *
SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)

$arif at khost:~/sak/SDL$ global -x SDL_Flip
SDL_Flip 1105 src/video/SDL_video.c int SDL_Flip(SDL_Surface
*screen)

But in hg tip, there is nothing.

arif at khost:~/sak/tests$ gcc sdl_load_image.c pkg-config --cflags --libs sdl2
sdl_load_image.c: In function ?main?:
sdl_load_image.c:9:9: warning: assignment makes pointer from integer
without a cast [enabled by default]
/tmp/cc4ZEiir.o: In function main': sdl_load_image.c:(.text+0x43): undefined reference toSDL_SetVideoMode’
sdl_load_image.c:(.text+0x9e): undefined reference to `SDL_Flip’
collect2: ld returned 1 exit status

grepping them comes up with nothing

arif at khost:~/sak/SDL$ hg tip
changeset: 7306:1516fe08e6ec
tag: tip
user: Sam Lantinga
date: Tue Jun 11 08:37:03 2013 -0700
summary: Added an arbitrary limit to the number of queued events
so it doesn’t grow unbounded.

SDL2 deprecated SDL_SetVideoMode, and now abstracts video handling by
handling multiple windows. Check out the migration
guidehttp://wiki.libsdl.org/moin.fcg/MigrationGuide
.On Wed, Jun 12, 2013 at 10:15 AM, arif wrote:

Hi,

A simple test code is not building because there is not SDL_SetVideoMode()
and SDL_Flip() in SDL2.

What happened to them? Who replaced them?

In version 1.2.15

$arif at khost:~/sak/SDL$ global -x SDL_SetVideoMode
SDL_SetVideoMode 583 src/video/SDL_video.c SDL_Surface * SDL_SetVideoMode
(int width, int height, int bpp, Uint32 flags)

$arif at khost:~/sak/SDL$ global -x SDL_Flip
SDL_Flip 1105 src/video/SDL_video.c int SDL_Flip(SDL_Surface
*screen)

But in hg tip, there is nothing.

arif at khost:~/sak/tests$ gcc sdl_load_image.c pkg-config --cflags --libs sdl2
sdl_load_image.c: In function ?main?:
sdl_load_image.c:9:9: warning: assignment makes pointer from integer
without a cast [enabled by default]
/tmp/cc4ZEiir.o: In function main': sdl_load_image.c:(.text+0x43): undefined reference toSDL_SetVideoMode’
sdl_load_image.c:(.text+0x9e): undefined reference to `SDL_Flip’
collect2: ld returned 1 exit status

grepping them comes up with nothing

arif at khost:~/sak/SDL$ hg tip
changeset: 7306:1516fe08e6ec
tag: tip
user: Sam Lantinga
date: Tue Jun 11 08:37:03 2013 -0700
summary: Added an arbitrary limit to the number of queued events so it
doesn’t grow unbounded.


Cheers
arif

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

http://wiki.libsdl.org/moin.fcg/MigrationGuide
"You update the physical screen using SDL_RenderPresent
http://wiki.libsdl.org/moin.fcg/SDL_RenderPresent, which replaces
SDL_Flip and SDL_UpdateRects. "
"SDL_SetVideoMode from 1.2 is now just a compatibility function, you
will not use it anymore. You can use SDL_GetWindowSurface
http://wiki.libsdl.org/moin.fcg/SDL_GetWindowSurface to get a 1.2
style surface for a window if necessary. "

Thanks for link to MigrationGuide. I was unaware of that. That actually
fixed two of problems. The other one is still hanging in this mailing list.On 06/12/2013 08:19 PM, Andreas Schiffler wrote:

On 6/12/2013 7:15 AM, arif wrote:

Hi,

A simple test code is not building because there is not
SDL_SetVideoMode() and SDL_Flip() in SDL2.

What happened to them? Who replaced them?

In version 1.2.15

$arif at khost:~/sak/SDL$ global -x SDL_SetVideoMode
SDL_SetVideoMode 583 src/video/SDL_video.c SDL_Surface *
SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)

$arif at khost:~/sak/SDL$ global -x SDL_Flip
SDL_Flip 1105 src/video/SDL_video.c int SDL_Flip(SDL_Surface
*screen)

But in hg tip, there is nothing.

arif at khost:~/sak/tests$ gcc sdl_load_image.c pkg-config --cflags --libs sdl2
sdl_load_image.c: In function ?main?:
sdl_load_image.c:9:9: warning: assignment makes pointer from integer
without a cast [enabled by default]
/tmp/cc4ZEiir.o: In function main': sdl_load_image.c:(.text+0x43): undefined reference toSDL_SetVideoMode’
sdl_load_image.c:(.text+0x9e): undefined reference to `SDL_Flip’
collect2: ld returned 1 exit status

grepping them comes up with nothing

arif at khost:~/sak/SDL$ hg tip
changeset: 7306:1516fe08e6ec
tag: tip
user: Sam Lantinga
date: Tue Jun 11 08:37:03 2013 -0700
summary: Added an arbitrary limit to the number of queued events
so it doesn’t grow unbounded.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Cheers
arif