Open GL, Linux, Windows

Hi SDL experts,

For a customer I need to create a cross-platform 2D graphic application that
is supposed to do fast panning and zooming of a huge picture. It is supposed
to run in Windows and in Linux environments.

I’d like to use SDL to have the program access the Video hardware in a
common way.

I’d like to use OpenGL (and/or DirectX) to grant SDL access to the fast
hardware features.

I did a little test version of some of aspects that application and found
that I need to use a the fast graphic in a (single) Window of the
application. while the rest of the frame should be standard GUI setup. This
does work fine with SDL in Linux and in Windows when I use standard GUI
video mode for SDL. But in Windows I can’t use Direct X. The application
just crashes when the SDL-Windows is initialized while Direct X use is
activated vie the appropriate environment setting. In Linux there is no
Direct X of course . I hope I can get it running in Windows and in
Linux when I use OpenGL. So the next step is testing this.

I recently got an Elsa Victory Erazor video card (RIVA 128 Chip) that I
thought would have OpenGL drivers for Windows and Linux. But I found
neither. (I am very ignorant about how Open GL is to be installed anyway.)

Can anybody tell me how I should proceed ? I easily can buy a Video card,
when this is suggested. But same needs to work with OpenGL in Windows and in
Linux.

Thanks a lot for any reply !

-Michael Schnell, Krefeld, Germany,
mailto:@Michael_Schnell

Hi SDL experts,

For a customer I need to create a cross-platform 2D graphic application that
is supposed to do fast panning and zooming of a huge picture. It is supposed
to run in Windows and in Linux environments.

I’d like to use SDL to have the program access the Video hardware in a
common way.

I’d like to use OpenGL (and/or DirectX) to grant SDL access to the fast
hardware features.

I did a little test version of some of aspects that application and found
that I need to use a the fast graphic in a (single) Window of the
application. while the rest of the frame should be standard GUI setup. This
does work fine with SDL in Linux and in Windows when I use standard GUI
video mode for SDL. But in Windows I can’t use Direct X. The application
just crashes when the SDL-Windows is initialized while Direct X use is
activated vie the appropriate environment setting. In Linux there is no
Direct X of course . I hope I can get it running in Windows and in
Linux when I use OpenGL. So the next step is testing this.

I recently got an Elsa Victory Erazor video card (RIVA 128 Chip) that I
thought would have OpenGL drivers for Windows and Linux. But I found
neither. (I am very ignorant about how Open GL is to be installed anyway.)

Can anybody tell me how I should proceed ? I easily can buy a Video card,
when this is suggested. But same needs to work with OpenGL in Windows and in
Linux.

Thanks a lot for any reply !

-Michael Schnell, Krefeld, Germany,
mailto:@Michael_Schnell

Michael Schnell wrote:

Hi SDL experts,

For a customer I need to create a cross-platform 2D graphic application that
is supposed to do fast panning and zooming of a huge picture. It is supposed
to run in Windows and in Linux environments.

I’d like to use SDL to have the program access the Video hardware in a
common way.

I’d like to use OpenGL (and/or DirectX) to grant SDL access to the fast
hardware features.

I did a little test version of some of aspects that application and found
that I need to use a the fast graphic in a (single) Window of the
application. while the rest of the frame should be standard GUI setup. This
does work fine with SDL in Linux and in Windows when I use standard GUI
video mode for SDL. But in Windows I can’t use Direct X. The application
just crashes when the SDL-Windows is initialized while Direct X use is
activated vie the appropriate environment setting. In Linux there is no
Direct X of course . I hope I can get it running in Windows and in
Linux when I use OpenGL. So the next step is testing this.

I recently got an Elsa Victory Erazor video card (RIVA 128 Chip) that I
thought would have OpenGL drivers for Windows and Linux. But I found
neither. (I am very ignorant about how Open GL is to be installed anyway.)

Can anybody tell me how I should proceed ? I easily can buy a Video card,
when this is suggested. But same needs to work with OpenGL in Windows and in
Linux.

Thanks a lot for any reply !

-Michael Schnell, Krefeld, Germany,
mailto:mschnell at bschnell.de


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

I’ll venture to reply, but I can’t gaurentee I’m especially useful. I
have to much learning left to do, myself.

Anyway, and windows openGL: every video card I have messed with does
install OpenGL drivers somewhere. I never have to mess with them, and
they don’t just out and say “here I am.” They just work, and this is
probably your situation as well. The libs and headers for OpenGL are
far more important for a developer, of course, and they come with
VisualC (or whatever tool you are using), not the video card. Linux
OpenGL… ooo, well I can’t remember include+lib locations and names off
of the top of my head, but Linux almost certainly does support OpenGL
acceleration on that video chip. A default Redhat 7.3 install should
set you up (worked for me last time, which is why my memory is fading).

These “standard GUI setup” things you speak of may be outside of the
realm of SDL. (It is also possible that I am confused what you are
talking about.) SDL will give you one window with it’s generic frame.
When I need buttons, I need to draw them myself (and handle clicks
myself, etc). There are SDL libraries for this as well. As far as “the
rest of the frame,” you’ll have to enforce that division youself because
it will all have to be part of the same window. Just draw things where
they belong… I imagine you know what I mean.

As far as directX vs OpenGL, I have found OpenGL works fine for all
platforms (with the possible exception of some persistient full-screen
problems on a few computers). I would recommend you just use OpenGL for
your work.

I imagine that you have a method for cleverly reading in from this large
file and converting it to OpenGL or directX textures. SDL’s and
SDL_image’s file readers will not gracefully handle truly large files.
I am also working on a large-image viewer for work (a satallite image
viewer), and I just tiled up the original image so that I didn’t have to
write a sneaky library to read in bits of a monolithic file as needed (I
beleive such libraries do exist, I think gqview ~1.0 uses such a thing,
but it is a RAM hog).

Anyway, I hope some of that was useful.

                                                        -ray skoog

Hi SDL experts,

For a customer I need to create a cross-platform 2D graphic application
that
is supposed to do fast panning and zooming of a huge picture. It is
supposed
to run in Windows and in Linux environments.

I recently got an Elsa Victory Erazor video card (RIVA 128 Chip) that I
thought would have OpenGL drivers for Windows and Linux. But I found
neither. (I am very ignorant about how Open GL is to be installed anyway.)

Can anybody tell me how I should proceed ? I easily can buy a Video card,
when this is suggested. But same needs to work with OpenGL in Windows and
in
Linux.

-Michael Schnell, Krefeld, Germany,

Michael,

Your new video card is manufactured by Nvidia. Their OpenGL support is the
best in the industry. If you go to:

http://developer.nvidia.com/view.asp?PAGE=opengl

you’ll see the download link for Nvidia’s OpenGL SDK. That OGL SDK will
contain libs, header and utilities that make life with OpenGL a bit easier.
With a little hunting around within the Nvidia’s developer site you will
also find the latest drivers for your video card for both Win32 and Linux.
(I’m pretty sure the Linux drivers are there too.) Nvidia uses a “unified
driver architecture” where they are continually updating their drivers, and
these updates deliver new drivers across their entire product line. So, no
matter what, you should get the latest drivers from the Nvidia site because
whatever drivers were present with your purchase are out of date.

Hope that helps.
-Blake

----- Original Message -----
From: mschnell@bschnell.de (Michael Schnell)
Sent: Thursday, June 13, 2002 2:02 PM
Subject: [SDL] Open GL, Linux, Window

The Linux drivers, however, are closed-source. This may or may not matter to
you, but it’s worth pointing out because it does matter to some folks. Since
the drivers involve a kernel module, there’s no telling what you may do to
the stability of the system.On Fri, Jun 14, 2002 at 07:26:35AM -0700, Blake Senftner wrote:

With a little hunting around within the Nvidia’s developer site you will
also find the latest drivers for your video card for both Win32 and Linux.


Matthew Miller @Matthew_Miller http://www.mattdm.org/
Boston University Linux ------> http://linux.bu.edu/

Hi SDL experts,
For a customer I need to create a cross-platform 2D graphic application that
is supposed to do fast panning and zooming of a huge picture. It is supposed
to run in Windows and in Linux environments.
I’d like to use SDL to have the program access the Video hardware in a
common way.
I’d like to use OpenGL (and/or DirectX) to grant SDL access to the fast
hardware features.

DirectX is Windows-only, so it’ll have to be OpenGL if you want Linux support.

I did a little test version of some of aspects that application and found
that I need to use a the fast graphic in a (single) Window of the
application. while the rest of the frame should be standard GUI setup. This
does work fine with SDL in Linux and in Windows when I use standard GUI
video mode for SDL. But in Windows I can’t use Direct X. The application
just crashes when the SDL-Windows is initialized while Direct X use is
activated vie the appropriate environment setting. In Linux there is no
Direct X of course . I hope I can get it running in Windows and in
Linux when I use OpenGL. So the next step is testing this.

I recently got an Elsa Victory Erazor video card (RIVA 128 Chip) that I
thought would have OpenGL drivers for Windows and Linux. But I found
neither. (I am very ignorant about how Open GL is to be installed anyway.)

The RIVA 128 is a rather old chip (NVIDIA’s first really successful GPU). It
uses an older architecture than the more recent chips. As far as I know, the
current Linux NVdriver does not support it.

Can anybody tell me how I should proceed ? I easily can buy a Video card,
when this is suggested. But same needs to work with OpenGL in Windows and in
Linux.

Any of NVIDIA’s current cards (GeForce 2 or later) should be well supported
for OpenGL in both Linux and Windows. Older GF2 cards are very cheap these
days. For Linux you’ll need the (unfortunately binary-only, but actively maintained)
driver from www.nvidia.com.

-JohnOn Thu, Jun 13, 2002 at 11:02:00PM +0200, Michael Schnell wrote:


John R. Hall, KG4RUO

The TNT2’s are well supported too. (We have tons of them here at the office).On Fri, Jun 14, 2002 at 11:24:53AM -0700, overcode at overcode.net wrote:

On Thu, Jun 13, 2002 at 11:02:00PM +0200, Michael Schnell wrote:
Any of NVIDIA’s current cards (GeForce 2 or later) should be well supported
for OpenGL in both Linux and Windows. Older GF2 cards are very cheap these
days. For Linux you’ll need the (unfortunately binary-only, but actively maintained)
driver from www.nvidia.com.

They make effective doorstops? runsOn Fri, Jun 14, 2002 at 03:54:49PM -0500, EvilTypeGuy wrote:

The TNT2’s are well supported too. (We have tons of them here at the office).


Joseph Carter The guy with a rocket launcher

There are worse things than Perl…ASP comes to mind

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020614/9a3aa65d/attachment.pgp

== Urspr?ngliche Mitteilung von sdl at libsdl.org am 14.06.02 10:08

These “standard GUI setup” things you speak of may be outside of the
realm of SDL. (It is also possible that I am confused what you are
talking about.) SDL will give you one window with it’s generic frame.

Right. SDL gives me a window, when I want to, I can include this window in
a bigger window that represents an application. My application is done with
Delphi/Kylix. Here the RAD helps m,e create the GUI /buttons etc.) outside
of the SDL window and inside the SDL window I do the fast graphics. there
is a toolset called “JEDI-SDL” that helps me access SDL from Delphi/Kylix
(this is just a wrapper for the appropriate SDL-functions). All this works
fine unless I activate Direct-X used for the SDL window. So it works when
SDL works in some kind of “standard GUI mode”. If I activate Direct-X for
the SDL-Window I get an access violation in the sdl dll.

When I need buttons, I need to draw them myself (and handle clicks
myself, etc).

This application has a very complex GUI setup. I do need to use RAD
(Delphi/Kylix) for this.

As far as directX vs OpenGL, I have found OpenGL works fine for all
platforms (with the possible exception of some persistient full-screen
problems on a few computers). I would recommend you just use OpenGL for
your work.

Thanks for the affirmation !

I imagine that you have a method for cleverly reading in from this large
file and converting it to OpenGL or directX textures. SDL’s and
SDL_image’s file readers will not gracefully handle truly large files.

I need to use files in (very) non-standard formats. So I really need to
create this code myself anyway.

I am also working on a large-image viewer for work (a satallite image
viewer), and I just tiled up the original image so that I didn’t have to
write a sneaky library to read in bits of a monolithic file as needed.

The images are small enough to fit in memory of a PC wit appropriate amount
of RAM, so I’d like just to blit them when necessary. I suppose there might
be some hardware support for the blitting. I do need a grid in front of the
picture which is zoomed and panned with it but the lines of which stay at
the same width. So I need fast line operations and/or overlay graphic.

Thanks !

-Michael Schnell, Krefeld, Germany,
mailto:@Michael_Schnell

— Michael Schnell wrote:

The images are small enough to fit in memory of a PC
wit appropriate amount
of RAM, so I’d like just to blit them when
necessary. I suppose there might
be some hardware support for the blitting. I do need
a grid in front of the
picture which is zoomed and panned with it but the
lines of which stay at
the same width. So I need fast line operations
and/or overlay graphic.

I think you said b4 that you are shoving the SDL
window into a parent window. While SDL does a great
job blitting (software or hardware, as apropriate),

From the discussion that I’ve been following the last
month I’ve gleaned the following information on the
state of things SDL that are relevant:

  1. On all platforms except Amiga, hardware surfaces
    are only availible in fullscreen mode.

  2. I think SDL only supports hardware accelerated
    blits between hardware surfaces, and (possibly) from
    software to hardware surfaces. You would be doing a
    blit between software surfaces it sounds like.

  3. SDL software blits are sufficiently fast, so I
    wouldn’t worry about it…

Best reguards,

-Loren

P.S. Please be aware that not all 3D accelerator cards
(such as Voodoo 1&2) are capible of 3D acceleration in
a window… This isn’t a SDL thing it’s a hardware
thing, so you may need to impose a minimum system
requirement for your deployed systems.__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

If then.On Sat, Jun 15, 2002 at 11:18:04AM -0700, Loren Osborn wrote:

  1. On all platforms except Amiga, hardware surfaces
    are only availible in fullscreen mode.


Matthew Miller @Matthew_Miller http://www.mattdm.org/
Boston University Linux ------> http://linux.bu.edu/

The images are small enough to fit in memory of a PC wit appropriate amount
of RAM, so I’d like just to blit them when necessary. I suppose there might
be some hardware support for the blitting. I do need a grid in front of the
picture which is zoomed and panned with it but the lines of which stay at
the same width. So I need fast line operations and/or overlay graphic.

OpenGL does those sorts of things very well, accelerated, on all major
OS’s… so long as you have a video card from the past 3 or 4 years,
and so long as you have drivers for it.

I found out how to convert SDL_Surfaces to OpenGL textures in a NeHe
demo (should be linked of the SDL page). Beyond that I have no
knowledge of how to get your data into OpenGL textures.

                                        -Ray Skoog

I found out how to convert SDL_Surfaces to OpenGL textures in a NeHe
demo (should be linked of the SDL page). Beyond that I have no
knowledge of how to get your data into OpenGL textures.

There’s a good example in the test/testgl.c example in the SDL source archive.

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

== Urspr?ngliche Mitteilung von sdl at libsdl.org am 14.06.02 16:26

Your new video card is manufactured by Nvidia. Their OpenGL support is the
best in the industry. If you go to:

http://developer.nvidia.com/view.asp?PAGE=opengl

=== Kommentar von MSCHNELL at MARIANNE (Michael Schnell) am 15.06.02 18:18

Thanks I’ll take a look. Good News, as Elsa seems to be out of busyness
(their site is down since at least a week) .

-Michael Schnell, Krefeld, Germany,
mailto:@Michael_Schnell

== Urspr?ngliche Mitteilung von sdl at libsdl.org am 14.06.02 16:26

Your new video card is manufactured by Nvidia. Their OpenGL support is the
best in the industry. If you go to:

http://developer.nvidia.com/view.asp?PAGE=opengl

=== Kommentar von MSCHNELL at MARIANNE (Michael Schnell) am 16.06.02 00:03

Did that.

Though it seems granted that the Victory erazor uses the Nvidia 128 Graphic
chip the Win98 open gl driver by Nvidia says: "no Nvidia Graphic card found"
It does not seem to like the Elsa card.

Thanks anyway. I think I should buy an original Nvidia card.

-Michael Schnell, Krefeld, Germany,
mailto:@Michael_Schnell

Loren, thanks for your hints,

  1. On all platforms except Amiga, hardware surfaces
    are only availible in fullscreen mode.

I think that’s odd, DirectX (without SDL) seems to be able to use hardware
surfaces in windowed mode.

  1. I think SDL only supports hardware accelerated
    blits between hardware surfaces, and (possibly) from
    software to hardware surfaces.

I suppose “hardware surfaces” are those the processor on the video card can
access (Till now I only have some experience with Direct X and there I think
this is the case. When you create a surface in an attribute you let can
request it to be either of software or hardware or automatic (->hardware if
memory is available, software otherwise).) If a video card can do PCI bus
master DMA, I suppose it can use PC memory for pseudo hardware surfaces.

What I’d like to do is use a hardware surface for the picture and (using a
zoom factor) blit part of it to an onscreen surface (that is located within
a window of the GUI. (We can do this using DirectX (without SDL) in
Windows).

You would be doing a
blit between software surfaces it sounds like.

  1. SDL software blits are sufficiently fast, so I
    wouldn’t worry about it…

If it’s software anyway, would it make sense to use OpenGL at all ? My SDL
example does work without it and its reasonably fast, but I’d like it to be
much faster, so I intended using OpenGL to enable hardware blitting.

Thanks,

-Michael Schnell, Krefeld, Germany,
mailto:@Michael_Schnell

— Michael Schnell wrote:

Loren, thanks for your hints,

sure

  1. On all platforms except Amiga, hardware surfaces
    are only availible in fullscreen mode.

I think that’s odd, DirectX (without SDL) seems to
be able to use hardware
surfaces in windowed mode.

This was discussed a few weeks ago. The problem is
that if SDL did this, it would have to clip the image
to exclude any windows that may be on top of it…
While this is certainly possible, I don’t even think
that even the Amiga port does this. If you feel
ambitious, I’m sure Sam would welcome a patch to
handle this case…

  1. I think SDL only supports hardware accelerated
    blits between hardware surfaces, and (possibly)
    from
    software to hardware surfaces.

I suppose “hardware surfaces” are those the
processor on the video card can
access (Till now I only have some experience with
Direct X and there I think
this is the case. When you create a surface in an
attribute you let can
request it to be either of software or hardware or
automatic (->hardware if
memory is available, software otherwise).) If a
video card can do PCI bus
master DMA, I suppose it can use PC memory for
pseudo hardware surfaces.

What I’d like to do is use a hardware surface for
the picture and (using a
zoom factor) blit part of it to an onscreen surface
(that is located within
a window of the GUI. (We can do this using DirectX
(without SDL) in
Windows).

The SDL video (non-OpenGL) stuff is all 2D image
manipulation. I guarentee that any “Zoom blit” that
it might have WILL NOT be accelerated! (That is
IF it has a “Zoom blit”)… So your need for having
your surface in video memory seems to have
disappeared.

You would be doing a
blit between software surfaces it sounds like.

  1. SDL software blits are sufficiently fast, so I
    wouldn’t worry about it…

If it’s software anyway, would it make sense to use
OpenGL at all ? My SDL
example does work without it and its reasonably
fast, but I’d like it to be
much faster, so I intended using OpenGL to enable
hardware blitting.

As you are doing zoom (and possibly roatation)
operations I thinks this leaves you with 3 choices:

  1. Do all your image manipulation (Zooming, rotation,
    warping, whatever) in software.

  2. Move to OpenGL and flip, zoom, streatch, or turn
    your images as needed as texture mapped surfaces.

  3. Try David’s glSDL wrapper (
    http://olofson.net/mixed.html ) to esentially wrap
    your 2D-esque operations in OpenGL for you…

Thanks,

-Michael Schnell, Krefeld, Germany,
mailto:mschnell at bschnell.de

Your welcome,

-Loren__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

Loren,

As you are doing zoom (and possibly roatation)
operations I thinks this leaves you with 3 choices:

  1. Do all your image manipulation (Zooming, rotation,
    warping, whatever) in software.

Do you mean in my software, or in software provided by SDL and/or OpenGL ?

  1. Move to OpenGL and flip, zoom, streatch, or turn
    your images as needed as texture mapped surfaces.

I’m not yet used to the proceedings of OpenGL, but this sound like what I
intended to do. Can SDL help here ? If not maybe I can write something SDL
compatible that helps connecting the user program to OpenGL ?

  1. Try David’s glSDL wrapper (
    http://olofson.net/mixed.html ) to esentially wrap
    your 2D-esque operations in OpenGL for you…

I’ll take a look !

Thanks a lot,

-Michael Schnell, Krefeld, Germany,
mailto:@Michael_Schnell

David’s glSDL wrapper

seems to be Linux only.

As I need to create an App that can be used in Windows and in Linux (that is
why I wanted to use SDL) I can’t use it. Bus as I need to do the stuff in
Pascal anyway, and as supposedly the only API I need is “stretchblt”, maybe
it can help me learn what I need to do to access OpenGL and I can recreate
the OpenGL access functions in Pascal for both environments. That would mean
dropping SDL (and you get rid of me ). Is this reasonable ?

-Michael Schnell, Krefeld, Germany,
mailto:@Michael_Schnell

== Urspr?ngliche Mitteilung von sdl at libsdl.org am 16.06.02 22:01

  1. On all platforms except Amiga, hardware surfaces
    are only availible in fullscreen mode.

The problem is
that if SDL did this, it would have to clip the image
to exclude any windows that may be on top of it…

Right. That is why Direct X has a function for that purpose that can be
called by the user (making the graphic window slow) or not (destroying GUI
windows that are on top of the graphic Window, thus making the app
"pseudo-fullscreen"). For my app I would (and have for the current version)
choose (2).

While this is certainly possible, I don’t even think
that even the Amiga port does this. If you feel
ambitious, I’m sure Sam would welcome a patch to
handle this case…

Do you think SDL/OpenGL prevents the use of hardware acceleration in
non-fullscreen mode, or can I enable it and live with the shortcomings ?

Thanks,

-Michael Schnell, Krefeld, Germany,
mailto:@Michael_Schnell