# Init 2

**URL:** <https://discourse.libsdl.org/t/init-2/6758>\
**Category:** SDL Development\
**Created:** [May 30, 2002, 9:27am UTC](https://discourse.libsdl.org/t/init-2/6758 "2002-05-30T09:27:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/90db22/32.png) [@Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/u/Grzegorz_Jaskiewicz)\
**Post date:** [May 30, 2002, 9:27am UTC](https://discourse.libsdl.org/t/init-2/6758/1 "2002-05-30T09:27:01Z")

</div>

i wrote simple test program, and i was shocked !

it’s attached.  
all answers are no or 0. Only window manager is on my X system, acording to  
SDL !  
what is wrong ?

Grzegorz Jaskiewicz  
C/C++/PERL/PHP/SQL Programmer  
-------------- next part --------------  
A non-text attachment was scrubbed…  
Name: gr.cpp  
Type: application/octet-stream  
Size: 1589 bytes  
Desc: not available  
URL: [http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020530/d08bd8b2/attachment.obj](http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020530/d08bd8b2/attachment.obj)

---

<div class="post-metadata">

**Author:** ![mike\_shoup](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/m/c0e974/32.png) [@mike\_shoup](https://discourse.libsdl.org/u/mike_shoup)\
**Post date:** [May 30, 2002, 10:06am UTC](https://discourse.libsdl.org/t/init-2/6758/2 "2002-05-30T10:06:01Z")

</div>

> i wrote simple test program, and i was shocked !
> 
> it’s attached.  
> all answers are no or 0. Only window manager is on my X system, acording to  
> SDL !  
> what is wrong ?

That is normal if you are using Xwindows. (Unless you use DGA?)\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
Chat with friends online, try MSN Messenger: [http://messenger.msn.com](http://messenger.msn.com)

---

<div class="post-metadata">

**Author:** ![Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/90db22/32.png) [@Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/u/Grzegorz_Jaskiewicz)\
**Post date:** [May 30, 2002, 10:13am UTC](https://discourse.libsdl.org/t/init-2/6758/3 "2002-05-30T10:13:01Z")

</div>

> > i wrote simple test program, and i was shocked !
> > 
> > it’s attached.  
> > all answers are no or 0. Only window manager is on my X system, acording  
> > to  
> > SDL !  
> > what is wrong ?
> 
> That is normal if you are using Xwindows. (Unless you use DGA?)

if so, then how should i make detection of that stuff !!!

---

<div class="post-metadata">

**Author:** ![Matthew\_Miller](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/matthew_miller/32/185_2.png) [@Matthew\_Miller](https://discourse.libsdl.org/u/Matthew_Miller)\
**Post date:** [May 30, 2002, 10:25am UTC](https://discourse.libsdl.org/t/init-2/6758/4 "2002-05-30T10:25:01Z")

</div>

I think you misunderstand. That stuff _is_ being detected correctly as not  
available.On Thu, May 30, 2002 at 07:14:12PM +0200, Grzegorz Jaskiewicz wrote:

> > That is normal if you are using Xwindows. (Unless you use DGA?)  
> > if so, then how should i make detection of that stuff !!!

–  
Matthew Miller @Matthew_Miller[http://www.mattdm.org/](http://www.mattdm.org/)  
Boston University Linux ------\> [http://linux.bu.edu/](http://linux.bu.edu/)

---

<div class="post-metadata">

**Author:** ![Rainer\_Deyke](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/r/a9a28c/32.png) [@Rainer\_Deyke](https://discourse.libsdl.org/u/Rainer_Deyke)\
**Post date:** [May 30, 2002, 10:26am UTC](https://discourse.libsdl.org/t/init-2/6758/5 "2002-05-30T10:26:01Z")

</div>

“Grzegorz Jaskiewicz” \<gj\_22 at wp.pl\> wrote in message  
news:mailman.1022778788.30798.sdl at [libsdl.org](http://libsdl.org)…

> > > i wrote simple test program, and i was shocked !
> > > 
> > > it’s attached.  
> > > all answers are no or 0. Only window manager is on my X system,  
> > > acording  
> > > to  
> > > SDL !  
> > > what is wrong ?
> > 
> > That is normal if you are using Xwindows. (Unless you use DGA?)
> 
> if so, then how should i make detection of that stuff !!!

Everything is detected correctly. You really don’t have any kind of  
hardware acceleration under X. Deal with it.–  
Rainer Deyke | root at [rainerdeyke.com](http://rainerdeyke.com) | [http://rainerdeyke.com](http://rainerdeyke.com)

---

<div class="post-metadata">

**Author:** ![Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/90db22/32.png) [@Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/u/Grzegorz_Jaskiewicz)\
**Post date:** [May 30, 2002, 10:32am UTC](https://discourse.libsdl.org/t/init-2/6758/6 "2002-05-30T10:32:01Z")

</div>

> Everything is detected correctly. You really don’t have any kind of  
> hardware acceleration under X. Deal with it.  
> ???

---

<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:** [May 30, 2002, 10:54am UTC](https://discourse.libsdl.org/t/init-2/6758/7 "2002-05-30T10:54:00Z")

</div>

> i wrote simple test program, and i was shocked !

> it’s attached.  
> all answers are no or 0. Only window manager is on my X system, acording to  
> SDL !  
> what is wrong ?

This is a FAQ:  
[http://www.libsdl.org/faq.php?action=listentries&category=2#20](http://www.libsdl.org/faq.php?action=listentries&category=2#20)

```
-Sam Lantinga, Software Engineer, Blizzard Entertainment

```

---

<div class="post-metadata">

**Author:** ![Niels\_Wagenaar](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/n/9dc877/32.png) [@Niels\_Wagenaar](https://discourse.libsdl.org/u/Niels_Wagenaar)\
**Post date:** [May 30, 2002, 10:56am UTC](https://discourse.libsdl.org/t/init-2/6758/8 "2002-05-30T10:56:00Z")

</div>

Grzegorz,

What they trying to say is the following :

1. SDL (or X11/X-Window System for that matter) doesn’t support  
hardware accelerated surfaces with the X-Window System (or  
X, X11, X-Windows or how you want to call it).

2. SDL supports hardware accelerated surface when you make use  
of the DGA library/toolkit.

3. SDL supports hardware acceleration (only?) under OpenGL by  
making use of the GLX libraries.

I hope this clears it 🙂 (Any errors, please make them correct).

Regards,

Niels Wagenaar\> -----Original Message-----

> From: sdl-admin at [libsdl.org](http://libsdl.org) [mailto:sdl-admin at [libsdl.org](http://libsdl.org)] On  
> Behalf Of Grzegorz Jaskiewicz  
> Sent: donderdag 30 mei 2002 19:34  
> To: sdl at [libsdl.org](http://libsdl.org)  
> Subject: Re: [SDL] init 2
> 
> > Everything is detected correctly. You really don’t have  
> > any kind of  
> > hardware acceleration under X. Deal with it.  
> > ???
> 
> * * *
> 
> SDL mailing list  
> SDL at [libsdl.org](http://libsdl.org)  
> [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

---

<div class="post-metadata">

**Author:** ![Matthew\_Miller](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/matthew_miller/32/185_2.png) [@Matthew\_Miller](https://discourse.libsdl.org/u/Matthew_Miller)\
**Post date:** [May 30, 2002, 11:04am UTC](https://discourse.libsdl.org/t/init-2/6758/9 "2002-05-30T11:04:00Z")

</div>

I’m not sure eight question marks counts as “dealing”.On Thu, May 30, 2002 at 07:33:51PM +0200, Grzegorz Jaskiewicz wrote:

> > Everything is detected correctly. You really don’t have any kind of  
> > hardware acceleration under X. Deal with it.  
> > ???

–  
Matthew Miller @Matthew_Miller[http://www.mattdm.org/](http://www.mattdm.org/)  
Boston University Linux ------\> [http://linux.bu.edu/](http://linux.bu.edu/)

---

<div class="post-metadata">

**Author:** ![Matthew\_Miller](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/matthew_miller/32/185_2.png) [@Matthew\_Miller](https://discourse.libsdl.org/u/Matthew_Miller)\
**Post date:** [May 30, 2002, 11:18am UTC](https://discourse.libsdl.org/t/init-2/6758/10 "2002-05-30T11:18:01Z")

</div>

Sorry folks (Grzegorz in particular, of course) if this comment came across  
as more harsh than necessary; I didn’t mean it to be.On Thu, May 30, 2002 at 02:03:32PM -0400, Matthew Miller wrote:

> I’m not sure eight question marks counts as “dealing”.

–  
Matthew Miller @Matthew_Miller[http://www.mattdm.org/](http://www.mattdm.org/)  
Boston University Linux ------\> [http://linux.bu.edu/](http://linux.bu.edu/)

---

<div class="post-metadata">

**Author:** ![Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/90db22/32.png) [@Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/u/Grzegorz_Jaskiewicz)\
**Post date:** [May 30, 2002, 11:28am UTC](https://discourse.libsdl.org/t/init-2/6758/11 "2002-05-30T11:28:01Z")

</div>

> This is a FAQ:  
> [http://www.libsdl.org/faq.php?action=listentries&category=2#20](http://www.libsdl.org/faq.php?action=listentries&category=2#20)

software buffer==sloooow buffer,  
do that means that i have to write it for OpenGL to have real fast 2d  
graphics ?  
guys from xfree should consider that, and change it !

what DGA is ?  
i will look in web, but clarify me what does it have with sdl, xwindows and  
\*nix ?

GJ.

---

<div class="post-metadata">

**Author:** ![Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/90db22/32.png) [@Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/u/Grzegorz_Jaskiewicz)\
**Post date:** [May 30, 2002, 11:29am UTC](https://discourse.libsdl.org/t/init-2/6758/12 "2002-05-30T11:29:00Z")

</div>

> > I’m not sure eight question marks counts as “dealing”.
> 
> Sorry folks (Grzegorz in particular, of course) if this comment came  
> across  
> as more harsh than necessary; I didn’t mean it to be.

sorry 😕

I’m new to X development. And I am just digging problems…  
is that lists are for ?

gj.

---

<div class="post-metadata">

**Author:** ![David\_Olofson](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/david_olofson/32/115_2.png) [@David\_Olofson](https://discourse.libsdl.org/u/David_Olofson)\
**Post date:** [May 30, 2002, 12:02pm UTC](https://discourse.libsdl.org/t/init-2/6758/13 "2002-05-30T12:02:01Z")

</div>

> > This is a FAQ:  
> > [http://www.libsdl.org/faq.php?action=listentries&category=2#20](http://www.libsdl.org/faq.php?action=listentries&category=2#20)
> 
> software buffer==sloooow buffer,

Depends on what you compare it to, but getting stuff into VRAM _is_  
indeed a serious performance issue. However, if the (2D) driver doesn’t  
support h/w accelerated blits, software surfaces are the way to go.  
(Well, they’re usually the only kind you can get when there’s no h/w  
accelerated blits, but there’s no guarantee. There are a few  
unaccelerated targets that can still give you hardware surfaces if you  
ask.)

> do that means that i have to write it for OpenGL to have real fast 2d  
> graphics ?

If your definition of “really fast” is similar to mine; yes, that seems  
to be the only remotely reliable way. (Despite all these issues with  
broken OpenGL features, I’d still say you’re much more likely to find a  
working OpenGL setup than any other kind of accelerated video on Linux.)

> guys from xfree should consider that, and change it !

Well, they wouldn’t be the first…

> what DGA is ?  
> i will look in web, but clarify me what does it have with sdl, xwindows  
> and \*nix ?

It’s a very low level “direct access” API for X. It requires root  
privileges, but it _can_ provide accelerated blits, if the drivers  
support it.

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.  
| Multimedia Application Integration Architecture |  
| A Free/Open Source Plugin API for Professional Multimedia |  
`----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter | `-------------------------------------\> [http://olofson.net](http://olofson.net) -'On Thursday 30 May 2002 20:09, Grzegorz Jaskiewicz wrote:

---

<div class="post-metadata">

**Author:** ![Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/90db22/32.png) [@Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/u/Grzegorz_Jaskiewicz)\
**Post date:** [May 30, 2002, 1:16pm UTC](https://discourse.libsdl.org/t/init-2/6758/14 "2002-05-30T13:16:01Z")

</div>

> > > what DGA is ?  
> > > i will look in web, but clarify me what does it have with sdl, xwindows  
> > > and \*nix ?

> > It’s a very low level “direct access” API for X. It requires root  
> > privileges, but it _can_ provide accelerated blits, if the drivers  
> > support it.

but X server runs with root priviliges, at least some parts. So i guess  
graphics stuff under X windows should use it !  
on the other hand, everything should be done way that doesn’t requires root  
priviliges ( in modules fe ).But i guess guys from  
[xfree.org](http://xfree.org) cannot do that becouse of portability issues…  
don’t you think so ?

gj.

---

<div class="post-metadata">

**Author:** ![icculus](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/icculus/32/81_2.png) [@icculus](https://discourse.libsdl.org/u/icculus)\
**Post date:** [May 30, 2002, 4:07pm UTC](https://discourse.libsdl.org/t/init-2/6758/15 "2002-05-30T16:07:02Z")

</div>

> software buffer==sloooow buffer,  
> do that means that i have to write it for OpenGL to have real fast 2d  
> graphics ?  
> guys from xfree should consider that, and change it !

We should really remove those flags from the next revision of SDL…all  
they seem to be used for is causing developer panic under X11.

A software buffer is frequently faster than a hardware buffer, which goes  
against intuition at first. Accessing video RAM directly is slow. It is  
much faster to do your work in system RAM (a software surface), and when  
you are done scribbling on the surface, send it in batch to the X server,  
which will then do a hardware-accelerated blit to video RAM (assuming that  
you have accelerated drivers, of course).

Software surface-based games that do a lot of calculations (I’m thinking  
Doom, Build, and Quake 1/2 with the software renderer) all get impressive  
framerates, even under X11.

So perhaps, “deal with it” isn’t the best response; “don’t worry about  
it” would be better.

–ryan.

---

<div class="post-metadata">

**Author:** ![icculus](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/icculus/32/81_2.png) [@icculus](https://discourse.libsdl.org/u/icculus)\
**Post date:** [May 30, 2002, 4:12pm UTC](https://discourse.libsdl.org/t/init-2/6758/16 "2002-05-30T16:12:01Z")

</div>

> If your definition of “really fast” is similar to mine; yes, that seems  
> to be the only remotely reliable way. (Despite all these issues with  
> broken OpenGL features, I’d still say you’re much more likely to find a  
> working OpenGL setup than any other kind of accelerated video on Linux.)

Just to echo David’s comments: OpenGL is going to give you better  
framerates, and doubly so at higher resolutions and color depths. Writing  
OpenGL code is very different from writing to a 2D linear framebuffer,  
though, and your code will be less likely to run out of the box  
(especially on today’s Linux, where the majority of systems seem to have  
misconfigured or nonexistant OpenGL support).

Like all things in game development, there are no absolutes, just  
trade-offs. Find what’s best out of a collection of flawed solutions.  
That’s what makes it exciting. 🙂

–ryan.

---

<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:** [May 30, 2002, 4:16pm UTC](https://discourse.libsdl.org/t/init-2/6758/17 "2002-05-30T16:16:09Z")

</div>

> Just to echo David’s comments: OpenGL is going to give you better  
> framerates, and doubly so at higher resolutions and color depths. Writing  
> OpenGL code is very different from writing to a 2D linear framebuffer,  
> though, and your code will be less likely to run out of the box  
> (especially on today’s Linux, where the majority of systems seem to have  
> misconfigured or nonexistant OpenGL support).

> Like all things in game development, there are no absolutes, just  
> trade-offs. Find what’s best out of a collection of flawed solutions.  
> That’s what makes it exciting. 🙂

Hear hear! 🙂

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

---

<div class="post-metadata">

**Author:** ![Rainer\_Deyke](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/r/a9a28c/32.png) [@Rainer\_Deyke](https://discourse.libsdl.org/u/Rainer_Deyke)\
**Post date:** [May 30, 2002, 4:31pm UTC](https://discourse.libsdl.org/t/init-2/6758/18 "2002-05-30T16:31:00Z")

</div>

“Ryan C. Gordon” wrote in message  
news:mailman.1022800327.14729.sdl at [libsdl.org](http://libsdl.org)…

> Just to echo David’s comments: OpenGL is going to give you better  
> framerates, and doubly so at higher resolutions and color depths.  
> Writing  
> OpenGL code is very different from writing to a 2D linear  
> framebuffer,  
> though, and your code will be less likely to run out of the box  
> (especially on today’s Linux, where the majority of systems seem to  
> have  
> misconfigured or nonexistant OpenGL support).

Not just “less likely to run out of the box”, but less likely to run  
at all. One of my computers (win98 BTW) has a Voodoo Banshee, which  
only has 3D acceleration at 16 bpp (and my desktop is at 32 bpp). My  
other computer has no 3D acceleration at all. (Running OpenGL without  
acceleration is for all intents and purposes the same as not running  
at all.)–  
Rainer Deyke | root at [rainerdeyke.com](http://rainerdeyke.com) | [http://rainerdeyke.com](http://rainerdeyke.com)

---

<div class="post-metadata">

**Author:** ![Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/g/90db22/32.png) [@Grzegorz\_Jaskiewicz](https://discourse.libsdl.org/u/Grzegorz_Jaskiewicz)\
**Post date:** [May 30, 2002, 4:34pm UTC](https://discourse.libsdl.org/t/init-2/6758/19 "2002-05-30T16:34:01Z")

</div>

> So perhaps, “deal with it” isn’t the best response; “don’t worry about  
> it” would be better.

😉

ok.

so there is only one man that really answer me, for that question.  
thx.

---

<div class="post-metadata">

**Author:** ![Matthew\_Miller](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/matthew_miller/32/185_2.png) [@Matthew\_Miller](https://discourse.libsdl.org/u/Matthew_Miller)\
**Post date:** [May 30, 2002, 4:37pm UTC](https://discourse.libsdl.org/t/init-2/6758/20 "2002-05-30T16:37:00Z")

</div>

So, to be clear, when the call returns that software to hardware blits are  
not accelerated, that’s different than saying that the X server won’t do  
hardware-accelerated blits?On Thu, May 30, 2002 at 07:11:01PM -0400, Ryan C. Gordon wrote:

> A software buffer is frequently faster than a hardware buffer, which goes  
> against intuition at first. Accessing video RAM directly is slow. It is  
> much faster to do your work in system RAM (a software surface), and when  
> you are done scribbling on the surface, send it in batch to the X server,  
> which will then do a hardware-accelerated blit to video RAM (assuming that  
> you have accelerated drivers, of course).

–  
Matthew Miller @Matthew_Miller[http://www.mattdm.org/](http://www.mattdm.org/)  
Boston University Linux ------\> [http://linux.bu.edu/](http://linux.bu.edu/)

[Next page](https://discourse.libsdl.org/t/init-2/6758.md?page=2)
