]> git.sesse.net Git - ccbs/blob - bigscreen/tinyptc/xdga1.h
Import TinyPTC 0.7.3 sources, switch from OpenGL to TinyPTC for now.
[ccbs] / bigscreen / tinyptc / xdga1.h
1 /*
2  * TinyPTC x11 v0.7.3 X Direct Graphics Access Extension v1 target
3  * Copyright (C) 2000-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_XDGA1_H
24 #define __PTC_XDGA1_H
25
26 #include <X11/Xlib.h>
27 #include <X11/Xutil.h>
28 #include <X11/extensions/xf86dga.h>
29 #include <X11/extensions/xf86vmode.h>
30 #include <stdio.h>
31 #include <stdlib.h>
32 #include <string.h>
33 #include <limits.h>
34 #include <unistd.h>
35 #include <sys/types.h>
36 #include "tinyptc.h"
37
38 #ifdef __PTC_XDGA1__
39
40 #ifdef __TINYPTC_INCLUDED
41 #error You chose more than one target. Please make your mind and try again.
42 #endif /* __TINYPTC_INCLUDED */
43
44 #define __TINYPTC_INCLUDED
45 #pragma target xdga1
46
47 #ifdef __cplusplus
48         extern "C" {
49 #endif /* __cplusplus */
50
51 int ptc_open (char *title, int width, int height);
52 int ptc_update (void *buffer);
53 void ptc_close (void);
54 int ptc_process_events (void);
55
56 #ifdef __cplusplus
57         }
58 #endif /* __cplusplus */
59
60 #endif /* __PTC_XDGA1__ */
61
62 #endif /* __PTC_XDGA1_H */
63
64 #ifdef __PTC_FROM_SOURCE
65
66 static Display *ptc_display;
67 static int ptc_screen;
68 static int ptc_screen_width;
69 static int ptc_screen_height;
70 static int ptc_viewport_width;
71 static int ptc_viewport_height;
72 static int ptc_depth;
73 static Window ptc_root_window;
74 static Visual *ptc_visual;
75 static char *ptc_buffer;
76 static int ptc_pixmap_format_count;
77 static int ptc_pixmap_counter;
78 static int ptc_converter_depth;
79 XPixmapFormatValues *ptc_pixmap_formats;
80
81 static char *ptc_framebuffer_address;
82 static int ptc_framebuffer_width;
83 static int ptc_framebuffer_banksize;
84 static int ptc_framebuffer_memory;
85 static int ptc_framebuffer_start;
86 static int ptc_framebuffer_pitch;
87 static int ptc_framebuffer_index;
88 static int ptc_totalmodes;
89 static int ptc_dotclock;
90 static int ptc_modecounter;
91 static int ptc_previousmode_number;
92 static int ptc_event_base;
93 static int ptc_error_base;
94 static int ptc_blitcounter;
95 static int ptc_output_pitch;
96 static Bool ptc_emulate_fullscreen;
97 static XF86VidModeModeInfo **ptc_modeinfodata;
98 static XF86VidModeModeLine ptc_currentmodeline;
99
100 #ifdef __PTC_BEST_VIDEOMODE__
101 static int ptc_best_x_delta;
102 static int ptc_best_y_delta;
103 static int ptc_best_videomode;
104 static int ptc_best_delta;
105 #endif /* __PTC_BEST_VIDEOMODE__ */
106
107 #ifdef __PTC_ENABLE_CONVERSIONS__
108 PTC_CONVERTER ptc_convert;
109 static int ptc_source_index;
110 static int ptc_destination_index;
111 #endif /* __PTC_ENABLE_CONVERSIONS__ */
112
113 #endif /* __PTC_FROM_SOURCE */