Tizen 2.1 base
[platform/upstream/libbullet.git] / Extras / RigidBodyGpuPipeline / opencl / gpu_rigidbody_pipeline2 / Win32OpenGLRenderManager.h
1 /*\r
2 Copyright (c) 2012 Advanced Micro Devices, Inc.  \r
3 \r
4 This software is provided 'as-is', without any express or implied warranty.\r
5 In no event will the authors be held liable for any damages arising from the use of this software.\r
6 Permission is granted to anyone to use this software for any purpose, \r
7 including commercial applications, and to alter it and redistribute it freely, \r
8 subject to the following restrictions:\r
9 \r
10 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\r
11 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\r
12 3. This notice may not be removed or altered from any source distribution.\r
13 */\r
14 //Originally written by Erwin Coumans\r
15 \r
16 \r
17 #ifndef _WIN32_OPENGL_RENDER_MANAGER_H\r
18 #define _WIN32_OPENGL_RENDER_MANAGER_H\r
19 \r
20 \r
21 #define RM_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name\r
22 \r
23 RM_DECLARE_HANDLE(RenderObjectHandle);\r
24 \r
25 struct InternalData2;\r
26 \r
27 class Win32OpenGLWindow\r
28 {\r
29         protected:\r
30                 \r
31                 struct InternalData2*   m_data;\r
32                 \r
33                 void enableOpenGL();\r
34                 \r
35                 void disableOpenGL();\r
36 \r
37                 void pumpMessage();\r
38         \r
39                 \r
40 \r
41 public:\r
42 \r
43         Win32OpenGLWindow();\r
44 \r
45         virtual ~Win32OpenGLWindow();\r
46 \r
47         virtual void    init(); //default implementation uses default settings for width/height/fullscreen\r
48 \r
49         void    init(int width,int height, bool fullscreen=false, int colorBitsPerPixel=0, void* windowHandle=0);\r
50         \r
51         void    switchFullScreen(bool fullscreen,int width=0,int height=0,int colorBitsPerPixel=0);\r
52 \r
53         virtual void    exit();\r
54 \r
55 \r
56         virtual void    startRendering();\r
57 \r
58         virtual void    renderAllObjects();\r
59 \r
60         virtual void    endRendering();\r
61 \r
62         virtual float   getTimeInSeconds();\r
63 \r
64         virtual void    setDebugMessage(int x,int y,const char* message);\r
65         \r
66         virtual bool requestedExit();\r
67 \r
68 };\r
69 \r
70 #endif //_WIN32_OPENGL_RENDER_MANAGER_H\r