• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# What is SDL?

## Recommended Posts

I know what is OpenGL (Open Graphic Libaries), but i dunno what is SDL????? And where can i find information regrading SDL? and 1 more thing..... How do other people can build a game engine that can run on both DirectX and OpenGL????

##### Share on other sites
Satan''s Dynamic Library

##### Share on other sites
Simple DirectMedia Layer. http://www.libsdl.org/

##### Share on other sites
SDL (Simple DirectMedia Layer) is just a cross platform abstraction layer or
quote:

SDL is a free cross-platform multi-media development API

With regards to the development of multi graphic/platform targets, its actually quite simple, at least in principle. Everything that relates to graphics are placed in 3 classes a abc (Abstract Base Class) class you could call CGraphic, which holds the methods you want to use. This could be a DrawTriangle method which is abstract, then you create a new class called CGraphicOpenGL and one called CGraphicDirectX which both inherits the CGraphic class. Now these classes must define this method, and you simply write the code used in OpenGL or DirectX in order to draw a triangel.

Then in your main program you do something like this:
  main (){ CGraphic* pGraphic; if (Settings->isOpenGl()) pGraphic = new CGraphicOpenGL; else pGraphic = new CGraphicDirectX; pGraphic->DrawTriangle(); delete pGraphics;}

And thats all there is to it. You can do this for every aspect of the engine, for example file access is different on Unix and Windows and you then just write 2 different classes both inheriting from the same abstract parent class.

Hope this helps, else have a look at the articles I'm pritty sure that there is an article on that.

-- Sturm

Edited by - Sturm on November 14, 2001 12:46:31 PM

Edited by - Sturm on November 14, 2001 12:48:01 PM

• ### Forum Statistics

• Total Topics
627734
• Total Posts
2978840

• 10
• 9
• 21
• 14
• 12