00001
00002 #ifndef OPENGL_DEVICE_H
00003 #define OPENGL_DEVICE_H
00004
00005 #if _MSC_VER > 1000
00006 #pragma once
00007 #endif // _MSC_VER > 1000
00008
00009 #include <windows.h>
00010
00015 class OpenGLDevice
00016 {
00017 public:
00018 OpenGLDevice(HDC& deviceContext,int stencil = 0);
00019 OpenGLDevice(HWND& window,int stencil = 0);
00020 OpenGLDevice();
00021
00022 bool create(HDC& deviceContext,int stencil = 0);
00023 bool create(HWND& window,int stencil = 0);
00024
00025 void destroy();
00026 void makeCurrent(bool disableOther = true);
00027
00028
00029 virtual ~OpenGLDevice();
00030
00031 protected:
00032 bool setDCPixelFormat(HDC& deviceContext,int stencil);
00033
00034 HGLRC renderContext;
00035 HDC deviceContext;
00036 };
00037
00038 #endif // ifndef OPENGL_DEVICE_H