Commit graph

72 commits

Author SHA1 Message Date
Sam Lantinga
5b2bf45c12 Clarified API documentation
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403728
2009-08-02 18:39:57 +00:00
Sam Lantinga
29167b5730 Documentation fix fix
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403692
2009-07-07 14:02:57 +00:00
Bob Pendleton
5d3a5aa3bd Documentation fix.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403688
2009-07-06 21:48:52 +00:00
Bob Pendleton
29a81c8167 Another documentation fix, Thanks to Mason Wheeler for finding these.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403686
2009-07-02 16:53:56 +00:00
Bob Pendleton
8625a0991d Documentation fix.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403685
2009-07-02 16:15:55 +00:00
Bob Pendleton
58ee3a8b76 Corrected documentation error for SDL_RenderFill.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403678
2009-06-30 22:19:10 +00:00
Sam Lantinga
483f2ba3fb indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403608
2009-05-23 22:41:08 +00:00
Sam Lantinga
ba096ad053 Date: Sun, 22 Mar 2009 12:52:29 +0000
From: Luke Benstead
Subject: OpenGL 3.0 Context Creation

I've attached a patch which implements OpenGL 3.x context creation on
the latest SVN. I've added two options to SDL_GL_SetAttribute, these
are SDL_GL_CONTEXT_MAJOR_VERSION and SDL_GL_CONTEXT_MINOR_VERSION.
These default to 2 and 1 respectively. If the major version is less
than 3 then the current context creation method is used, otherwise the
appropriate new context creation function is called (depending on the
platform).

Sample code:

    if (SDL_Init(SDL_INIT_VIDEO) != 0) {
        printf("Unable to initialize SDL: %s\n", SDL_GetError());
        return 1;
    }

    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); //Without these 2 lines, SDL will create a GL 2.x context
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);

    SDL_Surface* screen = SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL | SDL_FULLSCREEN );


I've implemented context creation on both Win32 and X and run basic
tests on both. This patch doesn't provide access to all the options
allowed by the new context creation (e.g. shared contexts, forward
compatible contexts) but they can be added pretty easily.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403567
2009-03-24 10:43:53 +00:00
Sam Lantinga
65fa34140f Fixed return value for SDL_CreateRenderer()
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403557
2009-03-15 15:50:18 +00:00
Sam Lantinga
2aab251e38 Added test program for SDL_CreateWindowFrom()
Make sure OpenGL library is loaded before working with OpenGL windows,
even those created with SDL_CreateWindowFrom()

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403521
2009-02-09 05:32:12 +00:00
Couriersud
aa47998f53 Fix third party "-Wall -Werror" builds
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403495
2009-01-12 22:36:12 +00:00
Sam Lantinga
4ca3bd3da1 Added an API to enable/disable the screen saver.
The screensaver is disabled by default when using SDL 1.2 compatibility.
Use the new XScreenSaver extension, removed unused DPMS extension.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403487
2009-01-12 06:19:05 +00:00
Sam Lantinga
1b9b40835c indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403452
2009-01-04 17:14:27 +00:00
Sam Lantinga
fea6781d86 Implemented SDL_SetWindowIcon(), with translucent icon support under X11.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403429
2009-01-02 17:39:48 +00:00
Sam Lantinga
382a1fe6c7 The _NET_WM_ICON protocol doesn't require the icon to be set before the window is shown.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403423
2009-01-02 09:50:25 +00:00
Sam Lantinga
01a9edc33a typo fix
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403369
2008-12-22 05:29:55 +00:00
Sam Lantinga
f055f6a189 Added RenderPiont() API
Merged the drawing tests into a single test program

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403363
2008-12-21 17:39:41 +00:00
Sam Lantinga
d29d0c965f Minor corrections
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403348
2008-12-20 12:32:38 +00:00
Sam Lantinga
9ba7210778 Date: Fri, 19 Dec 2008 20:17:35 +0100
From: Couriersud
Subject: Re: Aw: Experience using SDL1.3 in sdlmame/Proposal for api additions

> For consistency you'd probably want:
> SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a);
> SDL_SetRenderDrawBlendMode(SDL_BlendMode blendMode);
> SDL_RenderLine(int x1, int y1, int x2, int y2);
> SDL_RenderFill(SDL_Rect *rect);
>
> You probably also want to add API functions query the current state.
>

I have implemented the above api for the opengl, x11, directfb and
software renderers. I have also renamed *TEXTUREBLENDMODE* constants to
BLENDMODE*. The unix build compiles. The windows renderer still needs to
be updated, but I have no windows development machine at hand. Have a
look at the x11 renderer for a sample.

Vector games now run at 90% both on opengl and directfb in comparison to
sdlmame's own opengl renderer. The same applies to raster games.

The diff also includes

a) Changed XDrawRect to XFillRect in x11 renderer
b) A number of changes to fix blending and modulation issues in the
directfb renderer.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403346
2008-12-20 12:00:00 +00:00
Sam Lantinga
0c30a927ed Updated copyright date
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403321
2008-12-08 00:27:32 +00:00
Holmes Futrell
1051156e2b Added SDL_GL_RETAINED_BACKING attribute to SDL_GLattr
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403200
2008-09-02 20:27:47 +00:00
Sam Lantinga
68d2b55278 Split out the SDL_rect and SDL_surface functions into their own headers.
Removed unused count from the dirty rect list.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402639
2007-09-10 12:20:02 +00:00
Sam Lantinga
cf548d0a6b Okay, still some bugs, but everything builds again...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402629
2007-08-18 05:39:09 +00:00
Sam Lantinga
2e91636dda More work in progress integrating SDL_Surface and the new SDL_Texture API
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402628
2007-08-18 01:44:21 +00:00
Sam Lantinga
6b348f07c7 Emphasized the separation between SDL_Surface and SDL_Texture
- SDL_Surface is a system memory representation of pixel data
 - SDL_Texture is a video memory representation of pixel data

The concept of SDL_Surface with SDL_HWSURFACE is no longer used.

Separated SDL_Texture types by usage rather than memory type
 - SDL_TEXTUREACCESS_STATIC is for rarely changed pixel data,
   can be placed in video memory.
 - SDL_TEXTUREACCESS_STREAMING is for frequently changing pixel
   data, usually placed in system memory or AGP memory.

Optimized the SDL_compat usage of the OpenGL renderer by only
using one copy of the framebuffer instead of two.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402584
2007-08-11 20:54:31 +00:00
Sam Lantinga
9524d51857 Fixed bug #467
Remove trailing commas from enums

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402565
2007-07-22 13:22:47 +00:00
Bob Pendleton
5bb1d2ceb7 Added a WindowID to the user event and cleaned up a little bit of formating
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402370
2007-06-20 00:01:04 +00:00
Sam Lantinga
554147b6c7 make indent
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402345
2007-06-14 13:21:29 +00:00
Ryan C. Gordon
dfd9387039 Merged r3007:3008 from branches/SDL-1.2: MapRGB/MapRGBA const correctness.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402299
2007-04-04 09:43:53 +00:00
Sam Lantinga
2dc5a97f17 Cleanup for the last checkin
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402033
2006-08-28 03:27:59 +00:00
Sam Lantinga
fdafca64b3 Added source color and alpha modulation support.
Added perl script to generate optimized render copy functions.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402032
2006-08-28 03:17:39 +00:00
Sam Lantinga
461c8e2db4 Clarified the difference between render drivers and render contexts
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402016
2006-08-06 00:09:04 +00:00
Sam Lantinga
e36015a36c Updated header documentation
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402015
2006-08-05 22:41:33 +00:00
Sam Lantinga
a90680c736 In general, fill in pointers to structures, rather than return them.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402014
2006-08-05 22:34:23 +00:00
Sam Lantinga
ade506e8d5 Removed old function
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402013
2006-08-05 17:12:22 +00:00
Sam Lantinga
bfe4f31c0e SDL constants are all uppercase.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402012
2006-08-05 17:09:42 +00:00
Sam Lantinga
7b00c63ef6 Added SDL_GetCurrentVideoDisplay()
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402009
2006-08-02 03:20:52 +00:00
Sam Lantinga
c8d7322dc6 Simplified driver window creation code.
Implemented several Cocoa window functions

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402002
2006-07-29 21:51:00 +00:00
Sam Lantinga
79452369ef Implemented OpenGL support on Mac OS X
The OpenGL renderer works without changes, yay! :)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401982
2006-07-25 06:22:42 +00:00
Sam Lantinga
c05ca3687f Added SDL_GL_ExtensionSupported()
Use GL_ARB_texture_rectangle in the OpenGL renderer, if supported.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401971
2006-07-22 21:58:17 +00:00
Sam Lantinga
2fe561616a Convert SDL_malloc to SDL_calloc if appropriate, slightly faster on operating systems which map the zero page for memory allocations.
OpenGL renderer in progress

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401965
2006-07-22 08:33:18 +00:00
Sam Lantinga
2eed452d04 Setting up the OpenGL support
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401957
2006-07-16 09:34:01 +00:00
Sam Lantinga
d5d8761b60 Streamlined the API a bit and optimized the software renderer.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401952
2006-07-15 09:46:36 +00:00
Sam Lantinga
d1be2d9e1c Solved the performance problems by introducing the concept of a single-buffered
display, which is a fast path used for the whole-surface SDL 1.2 API.
Solved the flicker problems by implementing a backbuffer in the GDI renderer.

Unfortunately, now using the GDI renderer with a backbuffer and HBITMAPs is
significantly slower than SDL's surface code.  *sigh*

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401942
2006-07-12 06:39:26 +00:00
Sam Lantinga
0f030a1802 SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401938
2006-07-10 21:04:37 +00:00
Sam Lantinga
37adc6aae8 Implemented bug #5
Added SDL_GL_ACCELERATED_VISUAL to guarantee hardware acceleration.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401672
2006-04-27 08:39:51 +00:00
Sam Lantinga
b32d3f9c24 Implemented bug #2, 117:
Date: Mon, 21 Mar 2005 12:06:14 +0100
From: Per Inge Mathisen
Subject: Re: [SDL] Outstanding patches?

The patch adds support for setting SDL_GL_SWAP_CONTROL to Windows and
X11. In Windows you can also query this enum to check that it is
working, or see what the default is - such functionality does not
exist in GLX. For more information on the standards implemented:
http://oss.sgi.com/projects/ogl-sample/registry/SGI/swap_control.txt
http://oss.sgi.com/projects/ogl-sample/registry/EXT/wgl_swap_control.txt

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401671
2006-04-27 07:59:16 +00:00
Sam Lantinga
ab022a8987 Added current_w and current_h to the SDL_VideoInfo structure, which is set to the desktop resolution during video intialization, and then set to the current resolution when a video mode is set.
SDL_SetVideoMode() now accepts 0 for width or height and will use the current video mode (or the desktop mode if no mode has been set.)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401549
2006-03-15 17:46:41 +00:00
Sam Lantinga
cf05f2fab8 Fixed bug #139
The text in SDL_WM_SetCaption() is in UTF-8 encoding.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401509
2006-03-13 01:33:58 +00:00
Sam Lantinga
d12cf83d8f Dynamic OpenGL loading is the default now. :)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401494
2006-03-09 15:11:15 +00:00