Add more structure constructor tests.
[piglit/hramrach.git] / tests / glean / dsurf.h
blob9e81d9656283c0dc252273c32aea88019450395b
1 // BEGIN_COPYRIGHT -*- glean -*-
2 //
3 // Copyright (C) 1999 Allen Akin All Rights Reserved.
4 //
5 // Permission is hereby granted, free of charge, to any person
6 // obtaining a copy of this software and associated documentation
7 // files (the "Software"), to deal in the Software without
8 // restriction, including without limitation the rights to use,
9 // copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the
11 // Software is furnished to do so, subject to the following
12 // conditions:
13 //
14 // The above copyright notice and this permission notice shall be
15 // included in all copies or substantial portions of the
16 // Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19 // KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20 // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ALLEN AKIN BE
22 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 // AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 // OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 // DEALINGS IN THE SOFTWARE.
26 //
27 // END_COPYRIGHT
32 // dsurf.h: utilities for manipulating drawing surfaces
34 #ifndef __dsurf_h__
35 #define __dsurf_h__
37 #include "glwrap.h"
39 namespace GLEAN {
41 class WindowSystem; // Forward and mutually-recursive references
42 class DrawingSurfaceConfig;
44 class DrawingSurface {
45 public:
46 DrawingSurface(WindowSystem& ws, DrawingSurfaceConfig& c);
47 virtual ~DrawingSurface() { }
49 WindowSystem* winSys; // Window system that owns this surface.
50 DrawingSurfaceConfig* config; // Configuration of this surface.
52 protected:
53 void commonDestructorCode();
55 }; // class DrawingSurface
57 /* we have to create a utility test window for BeOS */
58 # if defined(__BEWIN__)
59 class GLTestWindow : public BWindow {
60 public:
61 GLTestWindow(BRect frame, const char *title);
62 void SwapBuffers();
63 // void SwapBuffers( bool vSync );
65 private:
66 BGLView *tView;
68 # endif
71 class Window: public DrawingSurface {
72 public:
73 Window(WindowSystem& ws, DrawingSurfaceConfig& c, int w, int h,
74 int x = 10, int y = 10);
75 ~Window();
77 // Utilities:
79 void swap();
81 // XXX Add constructors for more specialized window creation --
82 // for example, at a particular screen location, with a particular
83 // parent window, etc. -- as needed by new tests.
85 # if defined(__X11__)
86 ::Window xWindow;
87 # elif defined(__WIN__)
88 ::HWND hWindow;
89 ::HDC hDC;
91 ::HDC get_dc() const {return hDC;}
92 static LRESULT CALLBACK WindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
94 # elif defined(__BEWIN__)
95 GLTestWindow *tWindow;
96 # elif defined(__AGL__)
97 ::WindowRef macWindow;
98 # endif
99 }; // class Window
101 } // namespace GLEAN
103 #endif // __dsurf_h__