File: ScreenGraphics.h

package info (click to toggle)
transcend 0.3.dfsg2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,784 kB
  • sloc: cpp: 26,886; ansic: 693; sh: 210; makefile: 99; perl: 67
file content (73 lines) | stat: -rw-r--r-- 1,640 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
/*
 * Modification History
 *
 * 2000-November-18		Jason Rohrer
 * Created.
 */
 
#ifndef SCREEN_GRAPHICS_INCLUDED
#define SCREEN_GRAPHICS_INCLUDED


#include "GraphicBuffer.h"

/**
 * Interface for accessing full-screen, 32-bit graphics.
 */
class ScreenGraphics {
	
	public:
		
		/**
		 * Constructs a <code>ScreenGraphics</code>.
		 * Adjusts screen resolution and fills screen with black.
		 *
		 * @param inWidth width of desired full screen.
		 * @param inHeight height of desired full screen.
		 */
		ScreenGraphics( int inWidth, int inHeight );
		
		
		
		/**
		 * Desctructor restores screen to original state.
		 */
		~ScreenGraphics();
		
		
		/**
		 * Swaps a buffer to the screen.
		 * The next buffer to be filled is returned in <code>inOutBuffer</code>.
		 * No guarentee is made about what will be in the next buffer returned.
		 * (On systems that support on-card double buffering, it may even
		 * be a buffer pointing directly into video memory.)
		 *
		 * @param inOutBuffer pointer to the buffer to swap to the screen,
		 *   and pointer where the next buffer will be stored.
		 */
		void swapBuffers( GraphicBuffer *inOutBuffer );
		
		
		
		/**
		 * Determines whether a particular screen setting is available.
		 *
		 * NOTE:  Do not call after constructing a ScreenGraphics instance.
		 *
		 * @param inWidth width of desired full screen.
		 * @param inHeight height of desired full screen.
		 *
		 * @return true iff screen setting is available.
		 */
		 static char isResolutionAvailable( int inWidth, int inHeight );
			
			
	private:
	
		int mWidth;
		int mHeight;
		
		void *mNativeObjectPointer;
	};
	
#endif