annotate src/video/photon/SDL_photon_render.h @ 4583:5c925d4f220f

X11_DrawRects now uses a very hacky way of drawing rectangles with XRender. This will be improved in some time.
author Sunny Sachanandani <sunnysachanandani@gmail.com>
date Tue, 08 Jun 2010 19:26:32 +0530
parents f7b03b6838cb
children
rev   line source
3092
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1 /*
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
3697
f7b03b6838cb Fixed bug #926
Sam Lantinga <slouken@libsdl.org>
parents: 3396
diff changeset
3 Copyright (C) 1997-2010 Sam Lantinga
3092
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
4
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
9
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
13 Lesser General Public License for more details.
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
14
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
18
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
19 Sam Lantinga
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
20 slouken@libsdl.org
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
21
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
22 QNX Photon GUI SDL driver
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
23 Copyright (C) 2009 Mike Gorchak
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
24 (mike@malva.ua, lestat@i.com.ua)
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
25 */
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
26
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
27 #ifndef __SDL_PHOTON_RENDER_H__
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
28 #define __SDL_PHOTON_RENDER_H__
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
29
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
30 #include "../SDL_sysvideo.h"
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
31
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
32 #include <Ph.h>
3375
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
33 #include <photon/PhRender.h>
3092
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
34
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
35 #define SDL_PHOTON_MAX_SURFACES 3
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
36
3375
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
37 #define SDL_PHOTON_SURFTYPE_UNKNOWN 0x00000000
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
38 #define SDL_PHOTON_SURFTYPE_OFFSCREEN 0x00000001
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
39 #define SDL_PHOTON_SURFTYPE_PHIMAGE 0x00000002
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
40
3396
d6b79fc83362 All 2D operations in Photon driver have been finished. The driver is ready to use. There fullscreen modes and YUV textures are rest only.
Mike Gorchak <lestat@i.com.ua>
parents: 3387
diff changeset
41 #define SDL_PHOTON_UNKNOWN_BLEND 0x00000000
d6b79fc83362 All 2D operations in Photon driver have been finished. The driver is ready to use. There fullscreen modes and YUV textures are rest only.
Mike Gorchak <lestat@i.com.ua>
parents: 3387
diff changeset
42 #define SDL_PHOTON_DRAW_BLEND 0x00000001
d6b79fc83362 All 2D operations in Photon driver have been finished. The driver is ready to use. There fullscreen modes and YUV textures are rest only.
Mike Gorchak <lestat@i.com.ua>
parents: 3387
diff changeset
43 #define SDL_PHOTON_TEXTURE_BLEND 0x00000002
d6b79fc83362 All 2D operations in Photon driver have been finished. The driver is ready to use. There fullscreen modes and YUV textures are rest only.
Mike Gorchak <lestat@i.com.ua>
parents: 3387
diff changeset
44
3092
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
45 typedef struct SDL_RenderData
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
46 {
3375
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
47 SDL_bool enable_vsync; /* VSYNC flip synchronization enable */
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
48 uint32_t surface_visible_idx; /* Index of visible surface */
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
49 uint32_t surface_render_idx; /* Index of render surface */
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
50 uint32_t surfaces_count; /* Amount of allocated surfaces */
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
51 uint32_t surfaces_type; /* Type of allocated surfaces */
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
52 uint32_t window_width; /* Last active window width */
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
53 uint32_t window_height; /* Last active window height */
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
54 PhGC_t* gc; /* Graphics context */
3387
05499ec8c022 Initial support for fullscreen application modes.
Mike Gorchak <lestat@i.com.ua>
parents: 3383
diff changeset
55 SDL_bool direct_mode; /* Direct Mode state */
3375
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
56 PdOffscreenContext_t* osurfaces[SDL_PHOTON_MAX_SURFACES];
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
57 PhImage_t* psurfaces[SDL_PHOTON_MAX_SURFACES];
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
58 PmMemoryContext_t* pcontexts[SDL_PHOTON_MAX_SURFACES];
3092
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
59 } SDL_RenderData;
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
60
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
61 typedef struct SDL_TextureData
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
62 {
3383
90935231e9b6 Continue working on 2D support in Photon
Mike Gorchak <lestat@i.com.ua>
parents: 3375
diff changeset
63 uint32_t surface_type;
90935231e9b6 Continue working on 2D support in Photon
Mike Gorchak <lestat@i.com.ua>
parents: 3375
diff changeset
64 PdOffscreenContext_t* osurface;
90935231e9b6 Continue working on 2D support in Photon
Mike Gorchak <lestat@i.com.ua>
parents: 3375
diff changeset
65 PhImage_t* psurface;
90935231e9b6 Continue working on 2D support in Photon
Mike Gorchak <lestat@i.com.ua>
parents: 3375
diff changeset
66 PmMemoryContext_t* pcontext;
3092
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
67 } SDL_TextureData;
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
68
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
69 extern void photon_addrenderdriver(_THIS);
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
70
3375
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
71 /* Helper function, which redraws the backbuffer */
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
72 int _photon_update_rectangles(SDL_Renderer* renderer, PhRect_t* rect);
dd105b317335 Continue working on 2D support for Photon/QNX.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
73
3092
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
74 #endif /* __SDL_PHOTON_RENDER_H__ */
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
75
cad1aefa2ed9 Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
76 /* vi: set ts=4 sw=4 expandtab: */