Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #ifdef __APPLE__
- #include <OpenGL/OpenGL.h>
- #include "OpenGLView.h"
- #elif WIN32
- #include <Windows.h>
- #endif
- #ifdef __cplusplus
- #include "../System/System.h"
- namespace Goldberg
- {
- class Device
- {
- public:
- Device();
- ~Device();
- bool SwapBuffers() const;
- #ifdef __APPLE__
- bool Initialize(OpenGLView *view);
- NSOpenGLContext * const Context() const;
- NSOpenGLPixelFormat * const PixelFormat() const;
- #elif WIN32
- bool Initialize(HWND window);
- #endif
- private:
- DISALLOW_COPY_AND_ASSIGN(Device);
- #ifdef __APPLE__
- NSOpenGLContext *context;
- NSOpenGLPixelFormat *pixelFormat;
- OpenGLView *view;
- #elif WIN32
- HWND window;
- HDC deviceContext;
- HGLRC renderingContext;
- #endif
- };
- } // Goldberg
- extern "C"
- {
- #endif // __cplusplus
- typedef struct Device_s *DevicePtr;
- void DeviceCreate(DevicePtr *pDevice, OpenGLView *view);
- void DeviceDestroy(DevicePtr *pDevice);
- BOOL DeviceSwapBuffers(DevicePtr device);
- #ifdef __APPLE__
- NSOpenGLContext * DeviceGetContext(DevicePtr device);
- NSOpenGLPixelFormat *DeviceGetPixelFormat(DevicePtr device);
- void DeviceLock(DevicePtr device);
- void DeviceUnlock(DevicePtr device);
- #endif
- #ifdef __cplusplus
- }
- #endif // __cplusplus
Advertisement
Add Comment
Please, Sign In to add comment