File: gdev.C

package info (click to toggle)
sabre 0.2.4b-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,536 kB
  • ctags: 7,207
  • sloc: cpp: 36,926; ansic: 8,272; sh: 2,547; makefile: 208
file content (178 lines) | stat: -rw-r--r-- 4,012 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
// -*- mode: C; -*-
// jed does not understand .C

//
// Minefields:
// 
// This code is mine. You may use, modify or redistribute this code 
// in any APPROPRIATE manner you may choose. 
//  
// If you use, modify or redistribute this code, I am NOT responsible
// for ANY issue raised. 
// 
// ( If you modify or remove this note, this code is no longer mine. ) 
// 
// proff@iki.fi 
// 
//

// Thu Dec 18 00:19:40 EET 1997 (proff@alf.melmac)
// created file gdev.C

// Current version: 0.3.0 beta #15
// Last Modified:

//
// This simplified version was originally designed for Dan Hammer
// to use in his SABRE Fighter Plane Simulator
//

#include <stdio.h>
#include "gdev.h"

gdev *G = new gdev; // "There can be only one." (Sean Connery, 'Highlander')

gdev::gdev()
{
   gflags=0;
   vbuf=NULL;
}

// --
// -- method open( width, height, vicinity, wwidth, wheight ) 
// --
// -- returns the result of opening the graphics device in resolution
// -- width * height * vicinity (if parameters are omitted values
// -- 320x200x8bpp are used) returns non-zero value when open fails
// -- NB: it is hazardous to call gdev methods on unopened device
// -- so it user is responsible to check whether this call succeed 
// -- or not
// --

int gdev::open( int /* width */, int /* height*/, int /* vicinity*/, int /* wwidth*/, int /* wheight*/ )
{
   fprintf( stderr, "gdev: call to abstract class gdev in %s!\n", __FILE__ );
   return -1;
}

// --
// -- method setview( x0, y0, x1, y1 ) 
// --
// -- returns the value of setting viewport ranging upper left corner (x0,y0)
// -- to lower right corner (x1,y1) in device coordinates
// --

int gdev::setview( int /* x0*/, int /* y0*/, int /* x1*/, int /* y1*/ )
{
   return -1;
}

// --
// -- method close( ) 
// --
// -- returns the value of closing graphics device
// -- no parameters are used nor accepted
// --

int gdev::close( void )
{
   return -1;
}

// --
// -- method clear( fill, flags ) 
// --
// -- returns the value of clearing device/viewport by color palette index c
// -- first bit of flags (=1) clears viewport, second bit of flags (=2) clears
// -- graphics device
// --

int gdev::clear( int /* fill*/, int /* flags*/ )
{
   return -1;
}

// --
// -- method update( flags ) 
// --
// -- returns the value of updating device from viewport framebuffer
// --

int gdev::update( int /* partial */, int /* x0 */, int /* y0 */, int /* x1 */, int /* y1 */ )
{
   return -1;
}

// --
// -- method rect( x, y, w, h, c, fill ) 
// --
// -- returns the value of drawing rectangle ranging upper left corner (x0,y0)
// -- to lower right corner (x1,y1) in viewport coordinates
// --

int gdev::rect( int /* x*/, int /* y*/,  int /* w*/, int /* h*/, int /* c*/, int /* fill*/ )
{
   return -1;
}

// --
// -- method ( x, y, c ) 
// --
// -- returns the color palette index for viewport position (x,y)
// -- if color palette index c is not -1 viewport position (x,y) is
// -- set to c
// --

inline int gdev::pixel( int /* x*/, int /* y*/, int /* c*/ )
{
   return -1;
}

// --
// -- method line( x0, y0, x1, y1, c, *fill )
// --
// -- returns the result of line draw from (x0,y0) to (x1,y1) in viewpoint
// -- coordinates using colour palette index c and fill pattern in (non-zero)
// -- pointer fill (if fill is omitted fill is considered as zero)
// --

int gdev::line( int /* x0*/, int /* y0*/, int /* x1*/, int /* y1*/, int /* c*/, void * /* fill */ )
{
   return -1;
}

// --
// -- method event( wait )
// --
// -- returns pending event from input device or graphics system
// -- if wait is set to nonzero, method will block until some event
// -- occurs (if wait is omitted the value is zero ie. nonblocking)
// --

gevent *gdev::event( int /*wait*/ )
{
   return NULL;
}

rgbdev8 *RGB8 = new rgbdev8;


int rgbdev8::get( int , char * , char *  , char * ) 
{
   return 0;
}

int rgbdev8::set( int , char , char , char  ) 
{
   return 0;
}

int rgbdev8::get( void * , int , int  ) 
{
   return 0;
}

int rgbdev8::set( void * , int , int  ) 
{
   return 0;
}