]> git.sesse.net Git - ccbs/blob - bigscreen/tinyptc/xdga2.h
Import TinyPTC 0.7.3 sources, switch from OpenGL to TinyPTC for now.
[ccbs] / bigscreen / tinyptc / xdga2.h
1 /*
2  * TinyPTC x11 v0.7.3 X Direct Graphics Access Extension v2 target
3  * Copyright (C) 2001-2002 Alessandro Gatti <a.gatti@tiscali.it>
4  * 
5  * http://www.sourceforge.net/projects/tinyptc/
6  * 
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  *
21  */
22
23 #ifndef __PTC_XDGA2_H
24 #define __PTC_XDGA2_H
25
26 #include <X11/Xlib.h>
27 #include <X11/Xutil.h>
28 #include <X11/extensions/xf86dga.h>
29 #include <stdio.h>
30 #include <stdlib.h>
31 #include <string.h>
32 #include <limits.h>
33 #include <unistd.h>
34 #include <sys/types.h>
35 #include "tinyptc.h"
36
37 #ifdef __PTC_XDGA2__
38
39 #ifdef __TINYPTC_INCLUDED
40 #error You chose more than one target. Please make your mind and try again.
41 #endif /* __TINYPTC_INCLUDED */
42
43 #define __TINYPTC_INCLUDED
44 #pragma target xdga2
45
46 #ifdef __cplusplus
47         extern "C" {
48 #endif /* __cplusplus */
49
50 int ptc_open (char *title, int width, int height);
51 int ptc_update (void *buffer);
52 void ptc_close (void);
53 int ptc_process_events (void);
54
55 #ifdef __cplusplus
56         }
57 #endif /* __cplusplus */
58
59 #endif /* __PTC_XDGA2__ */
60
61 #endif /* __PTC_XDGA2_H */
62
63 #ifdef __PTC_FROM_SOURCE
64
65 static Display *ptc_display;
66 static int ptc_screen;
67 static int ptc_screen_width;
68 static int ptc_screen_height;
69 static int ptc_viewport_width;
70 static int ptc_viewport_height;
71 static Visual *ptc_visual;
72 static char *ptc_buffer;
73
74 static int ptc_framebuffer_start;
75 static int ptc_framebuffer_index;
76 static int ptc_dga_event_base;
77 static int ptc_error_base;
78 static int ptc_blitcounter;
79 static int ptc_dga_major_version;
80 static int ptc_dga_minor_version;
81
82 static int ptc_dga_video_length;
83 static Bool ptc_dga_emulate_fullscreen;
84
85 static int ptc_dga_output_pitch;
86 static char *ptc_dga_framebuffer_address;
87 static char *ptc_dga_first_page_address;
88 static char *ptc_dga_second_page_address;
89 static XDGAMode *ptc_dga_mode;
90 static XDGADevice *ptc_dga_device;
91 static Bool ptc_dga_first_page;
92 static int ptc_dga_modes;
93 static int ptc_dga_counter;
94 static int ptc_dga_new_mode;
95
96 #ifdef __PTC_ENABLE_CONVERSIONS__
97 static int ptc_dga_mode_32;
98 static int ptc_dga_mode_24;
99 static int ptc_dga_mode_16;
100 static int ptc_dga_mode_15;
101 #endif /* __PTC_ENABLE_CONVERSIONS__ */
102
103 #ifdef __PTC_BEST_VIDEOMODE__
104 #ifdef __PTC_ENABLE_CONVERSIONS__
105 typedef struct
106 {
107   int best_videomode;
108   int best_delta;
109 }
110 PTC_VIDEO_DATA;
111
112 static PTC_VIDEO_DATA ptc_dga_32;
113 static PTC_VIDEO_DATA ptc_dga_24;
114 static PTC_VIDEO_DATA ptc_dga_16;
115 static PTC_VIDEO_DATA ptc_dga_15;
116 #else
117 static int ptc_dga_best_videomode;
118 static int ptc_dga_best_delta;
119 #endif /* __PTC_ENABLE_CONVERSIONS__ */
120 static int ptc_dga_best_x_delta;
121 static int ptc_dga_best_y_delta;
122 #endif /* __PTC_BEST_VIDEOMODE__ */
123
124 #ifdef __PTC_ENABLE_CONVERSIONS__
125 PTC_CONVERTER ptc_convert;
126 static int ptc_source_index;
127 static int ptc_destination_index;
128 #endif /* __PTC_ENABLE_CONVERSIONS__ */
129
130 #endif /* __PTC_FROM_SOURCE */