-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpbwin.h
More file actions
86 lines (73 loc) · 1.94 KB
/
pbwin.h
File metadata and controls
86 lines (73 loc) · 1.94 KB
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
/* Copyright (C)2004 Landmark Graphics
* Copyright (C)2005-2008 Sun Microsystems, Inc.
*
* This library is free software and may be redistributed and/or modified under
* the terms of the wxWindows Library License, Version 3 or (at your option)
* any later version. The full license is in the LICENSE.txt file included
* with this distribution.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* wxWindows Library License for more details.
*/
#ifndef __PBWIN_H__
#define __PBWIN_H__
#include <windows.h>
#include <GL/gl.h>
#include <GL/wglext.h>
#include "rrmutex.h"
#include "rrblitter.h"
#include "fbx.h"
// A container class for the actual Pbuffer
class pbuffer
{
public:
pbuffer(HDC, int, int, int);
HDC hdc(void) {return _hdc;}
~pbuffer(void);
int width(void) {return _w;}
int height(void) {return _h;}
void clear(void);
void swap(void);
bool stereo(void) {return _stereo;}
private:
bool _cleared, _stereo;
HPBUFFERARB _drawable;
int _w, _h;
HDC _hdc;
};
class pbwin
{
public:
pbwin(HWND, HDC, int);
~pbwin(void);
void clear(void);
void cleanup(void);
HDC gethdc(void);
HDC updatehdc(void);
void resize(int, int);
void checkresize(void);
void initfromwindow(HDC);
void readback(GLint, bool);
void swapbuffers(void);
bool stereo(void);
bool _dirty, _rdirty;
private:
int init(HDC, int, int);
void readpixels(GLint, GLint, GLint, GLint, GLint, GLenum, int, GLubyte *,
GLint, bool stereo=false);
void makeanaglyph(rrframe *, int);
void sendw32(GLint, bool, bool, int);
bool _force;
rrcs _mutex;
HWND _hwnd;
pbuffer *_pb;
rrblitter *_blitter;
rrprofiler _prof_rb, _prof_gamma, _prof_anaglyph;
char _autotestclr[80], _autotestrclr[80], _autotestframe[80];
int _autotestframecount;
rrframe _r, _g, _b;
int _pixelformat;
};
#endif