# Sdl gdi

**URL:** <https://discourse.libsdl.org/t/sdl-gdi/16562>\
**Category:** SDL Development\
**Created:** [September 4, 2009, 3:05pm UTC](https://discourse.libsdl.org/t/sdl-gdi/16562 "2009-09-04T15:05:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GMScribe](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/f1d935/32.png) [@GMScribe](https://discourse.libsdl.org/u/GMScribe)\
**Post date:** [September 4, 2009, 3:05pm UTC](https://discourse.libsdl.org/t/sdl-gdi/16562/1 "2009-09-04T15:05:15Z")

</div>

Hi Guys,

I’m attempting to write a program that uses transparent windows (Microsoft  
Windows only is fine) where the desktop is visible behind objects that I  
draw, such as one of those assistants in microsoft office.

I plan on modifying SDL slightly to allow for transparent windows (which  
have been successful in standalone code).

My questions were:

1. I believe SDL 1.2 supports GDI, how do I ensure this is used instead of  
DirectX/OpenGL for blitting, as these methods are not compatible with  
transparent windows directly as they draw directly to the screen, bypassing  
transparency.

2. Does SDL 1.3 still support GDI blitting?

Many thanks for any help.–  
View this message in context: [http://www.nabble.com/SDL-GDI-tp25296097p25296097.html](http://www.nabble.com/SDL-GDI-tp25296097p25296097.html)  
Sent from the SDL mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![slouken](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ec9cab/32.png) [@slouken](https://discourse.libsdl.org/u/slouken)\
**Post date:** [September 5, 2009, 7:43am UTC](https://discourse.libsdl.org/t/sdl-gdi/16562/2 "2009-09-05T07:43:04Z")

</div>

1. Yes, GDI is the default in SDL 1.2

2. SDL 1.3 uses Direct3D by default, but you can select the GDI renderer  
explicitly.On Fri, Sep 4, 2009 at 8:05 AM, GMScribe \<ali\_lowe at [sky.com](http://sky.com)\> wrote:

> Hi Guys,
> 
> I’m attempting to write a program that uses transparent windows (Microsoft  
> Windows only is fine) where the desktop is visible behind objects that I  
> draw, such as one of those assistants in microsoft office.
> 
> I plan on modifying SDL slightly to allow for transparent windows (which  
> have been successful in standalone code).
> 
> My questions were:
> 
> 1. I believe SDL 1.2 supports GDI, how do I ensure this is used instead of  
> DirectX/OpenGL for blitting, as these methods are not compatible with  
> transparent windows directly as they draw directly to the screen, bypassing  
> transparency.
> 
> 2. Does SDL 1.3 still support GDI blitting?
> 
> ## Many thanks for any help.
> 
> View this message in context:  
> [http://www.nabble.com/SDL-GDI-tp25296097p25296097.html](http://www.nabble.com/SDL-GDI-tp25296097p25296097.html)  
> Sent from the SDL mailing list archive at [Nabble.com](http://Nabble.com).
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

–  
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

---

<div class="post-metadata">

**Author:** ![GMScribe](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/f1d935/32.png) [@GMScribe](https://discourse.libsdl.org/u/GMScribe)\
**Post date:** [September 6, 2009, 1:55am UTC](https://discourse.libsdl.org/t/sdl-gdi/16562/3 "2009-09-06T01:55:38Z")

</div>

Thank you,

I’m now using GDI in SDL 1.3 by disabling the openGL and DirectX renderers,  
however I had ran into the issue that blitting does not appear to be  
functioning.

There appears to be some kind of pixel alignment issue where the image or  
simple fillrect only covers about 2/3s of the width of the screen and only  
in black and white (I believe this is because each colour component is being  
assigned its own pixel?).

Are there any known issues?

Many thanks.

Sam Lantinga-4 wrote:\>

> 1. Yes, GDI is the default in SDL 1.2
> 
> 2. SDL 1.3 uses Direct3D by default, but you can select the GDI renderer  
> explicitly.
> 
> On Fri, Sep 4, 2009 at 8:05 AM, GMScribe \<@GMScribe\> wrote:
> 
> > Hi Guys,
> > 
> > I’m attempting to write a program that uses transparent windows  
> > (Microsoft  
> > Windows only is fine) where the desktop is visible behind objects that I  
> > draw, such as one of those assistants in microsoft office.
> > 
> > I plan on modifying SDL slightly to allow for transparent windows (which  
> > have been successful in standalone code).
> > 
> > My questions were:
> > 
> > 1. I believe SDL 1.2 supports GDI, how do I ensure this is used instead  
> > of  
> > DirectX/OpenGL for blitting, as these methods are not compatible with  
> > transparent windows directly as they draw directly to the screen,  
> > bypassing  
> > transparency.
> > 
> > 2. Does SDL 1.3 still support GDI blitting?
> > 
> > ## Many thanks for any help.
> > 
> > View this message in context:  
> > [http://www.nabble.com/SDL-GDI-tp25296097p25296097.html](http://www.nabble.com/SDL-GDI-tp25296097p25296097.html)  
> > Sent from the SDL mailing list archive at [Nabble.com](http://Nabble.com).
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> 
> –  
> -Sam Lantinga, Founder and President, Galaxy Gameworks LLC
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

–  
View this message in context: [http://www.nabble.com/SDL-GDI-tp25296097p25313954.html](http://www.nabble.com/SDL-GDI-tp25296097p25313954.html)  
Sent from the SDL mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![slouken](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ec9cab/32.png) [@slouken](https://discourse.libsdl.org/u/slouken)\
**Post date:** [September 6, 2009, 4:54am UTC](https://discourse.libsdl.org/t/sdl-gdi/16562/4 "2009-09-06T04:54:54Z")

</div>

Not offhand. Can you reproduce it with testsprite2 (which has command line  
parameters to specify renderer?)

Do you have a simple test case I can use to reproduce the problem?

Please enter a bug at [http://bugzilla.libsdl.org/](http://bugzilla.libsdl.org/)

Thanks!On Sat, Sep 5, 2009 at 6:55 PM, GMScribe \<ali\_lowe at [sky.com](http://sky.com)\> wrote:

> Thank you,
> 
> I’m now using GDI in SDL 1.3 by disabling the openGL and DirectX renderers,  
> however I had ran into the issue that blitting does not appear to be  
> functioning.
> 
> There appears to be some kind of pixel alignment issue where the image or  
> simple fillrect only covers about 2/3s of the width of the screen and only  
> in black and white (I believe this is because each colour component is  
> being  
> assigned its own pixel?).
> 
> Are there any known issues?
> 
> Many thanks.
> 
> Sam Lantinga-4 wrote:
> 
> > 1. Yes, GDI is the default in SDL 1.2
> > 
> > 2. SDL 1.3 uses Direct3D by default, but you can select the GDI renderer  
> > explicitly.
> > 
> > On Fri, Sep 4, 2009 at 8:05 AM, GMScribe \<ali\_lowe at [sky.com](http://sky.com)\> wrote:
> > 
> > > Hi Guys,
> > > 
> > > I’m attempting to write a program that uses transparent windows  
> > > (Microsoft  
> > > Windows only is fine) where the desktop is visible behind objects that I  
> > > draw, such as one of those assistants in microsoft office.
> > > 
> > > I plan on modifying SDL slightly to allow for transparent windows (which  
> > > have been successful in standalone code).
> > > 
> > > My questions were:
> > > 
> > > 1. I believe SDL 1.2 supports GDI, how do I ensure this is used instead  
> > > of  
> > > DirectX/OpenGL for blitting, as these methods are not compatible with  
> > > transparent windows directly as they draw directly to the screen,  
> > > bypassing  
> > > transparency.
> > > 
> > > 2. Does SDL 1.3 still support GDI blitting?
> > > 
> > > ## Many thanks for any help.
> > > 
> > > View this message in context:  
> > > [http://www.nabble.com/SDL-GDI-tp25296097p25296097.html](http://www.nabble.com/SDL-GDI-tp25296097p25296097.html)  
> > > Sent from the SDL mailing list archive at [Nabble.com](http://Nabble.com).
> > > 
> > > * * *
> > > 
> > > SDL mailing list  
> > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> > 
> > –  
> > -Sam Lantinga, Founder and President, Galaxy Gameworks LLC
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> 
> –  
> View this message in context:  
> [http://www.nabble.com/SDL-GDI-tp25296097p25313954.html](http://www.nabble.com/SDL-GDI-tp25296097p25313954.html)  
> Sent from the SDL mailing list archive at [Nabble.com](http://Nabble.com).
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

–  
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

---

<div class="post-metadata">

**Author:** ![GMScribe](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/f1d935/32.png) [@GMScribe](https://discourse.libsdl.org/u/GMScribe)\
**Post date:** [September 6, 2009, 11:18am UTC](https://discourse.libsdl.org/t/sdl-gdi/16562/5 "2009-09-06T11:18:23Z")

</div>

You’ll find the issue with the default SDL 1.3 testsprite (the first test  
sprite test). Testsprite2 is fine under GDI however functionality using the  
old blitting methods appears to be broken.

I am perfectly happy to use the methods in testsprite2 for rendering however  
there is not a clear and obvious pathway as to which functions I should use  
to create my window and assign a renderer etc. We really need some  
documentation for these new renderers. The testcase appears to be a mish  
mash or higher and lower level functions?

Many thanks.

Sam Lantinga-4 wrote:\>

> Not offhand. Can you reproduce it with testsprite2 (which has command  
> line  
> parameters to specify renderer?)
> 
> Do you have a simple test case I can use to reproduce the problem?
> 
> Please enter a bug at [http://bugzilla.libsdl.org/](http://bugzilla.libsdl.org/)
> 
> Thanks!
> 
> On Sat, Sep 5, 2009 at 6:55 PM, GMScribe \<@GMScribe\> wrote:
> 
> > Thank you,
> > 
> > I’m now using GDI in SDL 1.3 by disabling the openGL and DirectX  
> > renderers,  
> > however I had ran into the issue that blitting does not appear to be  
> > functioning.
> > 
> > There appears to be some kind of pixel alignment issue where the image or  
> > simple fillrect only covers about 2/3s of the width of the screen and  
> > only  
> > in black and white (I believe this is because each colour component is  
> > being  
> > assigned its own pixel?).
> > 
> > Are there any known issues?
> > 
> > Many thanks.
> > 
> > Sam Lantinga-4 wrote:
> > 
> > > 1. Yes, GDI is the default in SDL 1.2
> > > 
> > > 2. SDL 1.3 uses Direct3D by default, but you can select the GDI  
> > > renderer  
> > > explicitly.
> > > 
> > > On Fri, Sep 4, 2009 at 8:05 AM, GMScribe \<@GMScribe\> wrote:
> > > 
> > > > Hi Guys,
> > > > 
> > > > I’m attempting to write a program that uses transparent windows  
> > > > (Microsoft  
> > > > Windows only is fine) where the desktop is visible behind objects that  
> > > > I  
> > > > draw, such as one of those assistants in microsoft office.
> > > > 
> > > > I plan on modifying SDL slightly to allow for transparent windows  
> > > > (which  
> > > > have been successful in standalone code).
> > > > 
> > > > My questions were:
> > > > 
> > > > 1. I believe SDL 1.2 supports GDI, how do I ensure this is used  
> > > > instead  
> > > > of  
> > > > DirectX/OpenGL for blitting, as these methods are not compatible with  
> > > > transparent windows directly as they draw directly to the screen,  
> > > > bypassing  
> > > > transparency.
> > > > 
> > > > 2. Does SDL 1.3 still support GDI blitting?
> > > > 
> > > > ## Many thanks for any help.
> > > > 
> > > > View this message in context:  
> > > > [http://www.nabble.com/SDL-GDI-tp25296097p25296097.html](http://www.nabble.com/SDL-GDI-tp25296097p25296097.html)  
> > > > Sent from the SDL mailing list archive at [Nabble.com](http://Nabble.com).
> > > > 
> > > > * * *
> > > > 
> > > > SDL mailing list  
> > > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> > > 
> > > –  
> > > -Sam Lantinga, Founder and President, Galaxy Gameworks LLC
> > > 
> > > * * *
> > > 
> > > SDL mailing list  
> > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> > 
> > –  
> > View this message in context:  
> > [http://www.nabble.com/SDL-GDI-tp25296097p25313954.html](http://www.nabble.com/SDL-GDI-tp25296097p25313954.html)  
> > Sent from the SDL mailing list archive at [Nabble.com](http://Nabble.com).
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> 
> –  
> -Sam Lantinga, Founder and President, Galaxy Gameworks LLC
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

–  
View this message in context: [http://www.nabble.com/SDL-GDI-tp25296097p25316724.html](http://www.nabble.com/SDL-GDI-tp25296097p25316724.html)  
Sent from the SDL mailing list archive at [Nabble.com](http://Nabble.com).
