All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WindowsNativeState.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "EegeoWindowsGuard.h"
6 #include <EGL\egl.h>
7 #include <EGL\eglplatform.h>
8 
10 {
11 public:
13  : m_hinstance(NULL)
14  , m_window(0)
15  , m_width(0)
16  , m_height(0)
17  , m_fullScreen(false)
18  , m_requiresPBuffer(false)
19  , m_oversampleScale(0.f)
20  , m_deviceDpi(0.f)
21  {}
22 
23  inline static WindowsNativeState WindowsNativeState::Make(const std::string& appName, HINSTANCE hinstance, EGLNativeWindowType nativeWindowType, int width, int height, bool fullScreen, bool requiresPBuffer, float oversampleScale, const std::string& deviceModel, float deviceDpiconst, const std::string& assetsPath = std::string(""));
24  inline static WindowsNativeState* WindowsNativeState::Create(const std::string& appName, HINSTANCE hinstance, EGLNativeWindowType nativeWindowType, int width, int height, bool fullScreen, bool requiresPBuffer, float oversampleScale, const std::string& deviceModel, float deviceDpi);
25 
26  std::string GetAppName() const { return m_appName; }
27  HINSTANCE GetHInstance() const { return m_hinstance; }
28  EGLNativeWindowType GetWindow() const { return m_window; }
29  int GetWidth() const { return m_width; }
30  int GetHeight() const { return m_height; }
31  bool IsFullScreen() const { return m_fullScreen; }
32  bool RequiresPBuffer() const { return m_requiresPBuffer; }
33  float GetOversampleScale() const { return m_oversampleScale; }
34  std::string GetDeviceModel() const { return m_deviceModel; }
35  const std::string& GetAssetsFolder() const { return m_assetsFolder; }
36  float GetDeviceDpi() const { return m_deviceDpi; }
37 
38  void SetSize(int width, int height) { m_width = width, m_height = height; }
39 
40 private:
42  const std::string& appName,
43  HINSTANCE hinstance,
44  EGLNativeWindowType window,
45  int width,
46  int height,
47  bool fullScreen,
48  bool requiresPBuffer,
49  float oversampleScale,
50  const std::string& deviceModel,
51  float deviceDpi,
52  const std::string& assetsFolder)
53  : m_appName(appName)
54  , m_hinstance(hinstance)
55  , m_window(window)
56  , m_width(width)
57  , m_height(height)
58  , m_fullScreen(fullScreen)
59  , m_requiresPBuffer(requiresPBuffer)
60  , m_oversampleScale(oversampleScale)
61  , m_deviceModel(deviceModel)
62  , m_deviceDpi(deviceDpi)
63  , m_assetsFolder(assetsFolder)
64  {}
65 
66  std::string m_assetsFolder;
67  std::string m_appName;
68  HINSTANCE m_hinstance;
69  EGLNativeWindowType m_window;
70  int m_width;
71  int m_height;
72  bool m_fullScreen;
73  bool m_requiresPBuffer;
74  float m_oversampleScale;
75  std::string m_deviceModel;
76  float m_deviceDpi;
77 };
78 
79 
80 inline WindowsNativeState WindowsNativeState::Make(const std::string& appName, HINSTANCE hinstance, EGLNativeWindowType nativeWindowType, int width, int height, bool fullScreen, bool requiresPBuffer, float oversampleScale, const std::string& deviceModel, float deviceDpi, const std::string& assetsPath)
81 {
82  WindowsNativeState nativeState(appName, hinstance, nativeWindowType, width, height, fullScreen, requiresPBuffer, oversampleScale, deviceModel, deviceDpi, assetsPath);
83 
84  return nativeState;
85 }
86 
87 inline WindowsNativeState* WindowsNativeState::Create(const std::string& appName, HINSTANCE hinstance, EGLNativeWindowType nativeWindowType, int width, int height, bool fullScreen, bool requiresPBuffer, float oversampleScale, const std::string& deviceModel, float deviceDpi)
88 {
89  return Eegeo_NEW(WindowsNativeState)(appName, hinstance, nativeWindowType, width, height, fullScreen, requiresPBuffer, oversampleScale, deviceModel, deviceDpi, "");
90 }