# SDL\_GetVideoInfo strangeness

**URL:** <https://discourse.libsdl.org/t/sdl-getvideoinfo-strangeness/9761>\
**Category:** SDL Development\
**Created:** [November 28, 2003, 4:48pm UTC](https://discourse.libsdl.org/t/sdl-getvideoinfo-strangeness/9761 "2003-11-28T16:48:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Philip](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@John\_Philip](https://discourse.libsdl.org/u/John_Philip)\
**Post date:** [November 28, 2003, 4:48pm UTC](https://discourse.libsdl.org/t/sdl-getvideoinfo-strangeness/9761/1 "2003-11-28T16:48:01Z")

</div>

In Mac OS X with the Quartz driver, all flags returned by  
SDL\_GetVideoInfo() are always 0. This is obviously incorrect, can  
someone familiar with SDL’s Quartz driver comment on this?

(OS X 10.3.1, SDL 1.2.6)

---

<div class="post-metadata">

**Author:** ![Darrell\_Walisser](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/darrell_walisser/32/588_2.png) [@Darrell\_Walisser](https://discourse.libsdl.org/u/Darrell_Walisser)\
**Post date:** [November 29, 2003, 4:16pm UTC](https://discourse.libsdl.org/t/sdl-getvideoinfo-strangeness/9761/2 "2003-11-29T16:16:01Z")

</div>

I suppose the wm\_available should be set to 1, but otherwise the flags  
should be zero since there is no hardware surface support in Mac OS X  
(besides OpenGL, of course).

An OpenGL backend for SDL would be difficult to manage (perhaps  
impossible), since OpenGL doesn’t allow direct (pointer) access to the  
framebuffer. To test a pixel in the framebuffer, you have to copy it to  
system memory first, which can be quite slow.

An OpenGL frontend is another story - this can work very well, and many  
people have done it.On Nov 29, 2003, at 3:02 PM, sdl-request at [libsdl.org](http://libsdl.org) wrote:

> Message: 4  
> To: sdl at [libsdl.org](http://libsdl.org)  
> From: John Philip   
> Date: Fri, 28 Nov 2003 19:46:59 -0500  
> Subject: [SDL] SDL\_GetVideoInfo strangeness  
> Reply-To: sdl at [libsdl.org](http://libsdl.org)
> 
> In Mac OS X with the Quartz driver, all flags returned by  
> SDL\_GetVideoInfo() are always 0. This is obviously incorrect, can  
> someone familiar with SDL’s Quartz driver comment on this?
> 
> (OS X 10.3.1, SDL 1.2.6)

---

<div class="post-metadata">

**Author:** ![John\_Philip](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@John\_Philip](https://discourse.libsdl.org/u/John_Philip)\
**Post date:** [November 29, 2003, 10:57pm UTC](https://discourse.libsdl.org/t/sdl-getvideoinfo-strangeness/9761/3 "2003-11-29T22:57:01Z")

</div>

On my Mac OS X system, calling SDL\_SetVideoMode(SDL\_HWSURFACE |  
SDL\_FULLSCREEN | SDL\_DOUBLEBUF) results in a surface with the following  
flags:  
SDL\_HWSURFACE  
SDL\_NOFRAME  
SDL\_PREALLOC  
SDL\_DOUBLEBUF  
SDL\_FULLSCREEN

This SDL\_Surface for the screen claims to be a hardware surface, is it  
really? If so, SDL\_GetVideoInfo() should be returning hw\_available =  
true, and probably some other fields true as well.On Nov 29, 2003, at 7:15 PM, Darrell Walisser wrote:

> I suppose the wm\_available should be set to 1, but otherwise the flags  
> should be zero since there is no hardware surface support in Mac OS X  
> (besides OpenGL, of course).
> 
> An OpenGL backend for SDL would be difficult to manage (perhaps  
> impossible), since OpenGL doesn’t allow direct (pointer) access to the  
> framebuffer. To test a pixel in the framebuffer, you have to copy it  
> to system memory first, which can be quite slow.
> 
> An OpenGL frontend is another story - this can work very well, and  
> many people have done it.
> 
> On Nov 29, 2003, at 3:02 PM, sdl-request at [libsdl.org](http://libsdl.org) wrote:
> 
> > Message: 4  
> > To: sdl at [libsdl.org](http://libsdl.org)  
> > From: John Philip \<@John\_Philip\>  
> > Date: Fri, 28 Nov 2003 19:46:59 -0500  
> > Subject: [SDL] SDL\_GetVideoInfo strangeness  
> > Reply-To: sdl at [libsdl.org](http://libsdl.org)
> > 
> > In Mac OS X with the Quartz driver, all flags returned by  
> > SDL\_GetVideoInfo() are always 0. This is obviously incorrect, can  
> > someone familiar with SDL’s Quartz driver comment on this?
> > 
> > (OS X 10.3.1, SDL 1.2.6)

---

<div class="post-metadata">

**Author:** ![Darrell\_Walisser](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/darrell_walisser/32/588_2.png) [@Darrell\_Walisser](https://discourse.libsdl.org/u/Darrell_Walisser)\
**Post date:** [November 30, 2003, 12:56pm UTC](https://discourse.libsdl.org/t/sdl-getvideoinfo-strangeness/9761/4 "2003-11-30T12:56:00Z")

</div>

> Message: 9
> 
> On my Mac OS X system, calling SDL\_SetVideoMode(SDL\_HWSURFACE |  
> SDL\_FULLSCREEN | SDL\_DOUBLEBUF) results in a surface with the following  
> flags:  
> SDL\_HWSURFACE  
> SDL\_NOFRAME  
> SDL\_PREALLOC  
> SDL\_DOUBLEBUF  
> SDL\_FULLSCREEN
> 
> This SDL\_Surface for the screen claims to be a hardware surface, is it  
> really?

No, we are emulating page-flipping behavior in this case, primarily for  
the benefit of retrace-synchronized updates. The screen surface is  
actually a software surface that updates to the screen in another  
thread and in sync with the monitor (60hz on LCDs w/ADC or DVI). We had  
to use SDL\_HWSURFACE for compatibility with other platforms, otherwise  
I’d leave it out to avoid the confusion.

> If so, SDL\_GetVideoInfo() should be returning hw\_available =  
> true, and probably some other fields true as well.

Not necessarily. Even if we did have a true hardware screen surface,  
that does not imply that the implementation can perform hardware  
accelerated blits/fills. This is the case with a single-buffered  
hardware surface on Mac OS X, and probably with other targets as well.On Nov 30, 2003, at 3:01 PM, sdl-request at [libsdl.org](http://libsdl.org) wrote:

> From: John Philip   
> Subject: Re: [SDL] SDL\_GetVideoInfo strangeness  
> Date: Sun, 30 Nov 2003 01:56:37 -0500  
> To: sdl at [libsdl.org](http://libsdl.org)  
> Reply-To: sdl at [libsdl.org](http://libsdl.org)
