My Project
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
ParaEngine::CParaEngineGLView Class Reference
Inheritance diagram for ParaEngine::CParaEngineGLView:
ParaEngine::IObject ParaEngine::CRefCounted

Public Member Functions

const GLContextAttrsgetGLContextAttrs ()
 Return the OpenGL context attrs. More...
 
float getFrameZoomFactor () const
 
void setViewPortInPoints (float x, float y, float w, float h)
 
void setScissorInPoints (float x, float y, float w, float h)
 
bool windowShouldClose ()
 
void pollEvents ()
 
GLFWwindow * getWindow () const
 
bool isOpenGLReady ()
 
void end ()
 
void swapBuffers ()
 
void setIMEKeyboardState (bool bOpen)
 
void setFrameZoomFactor (float zoomFactor)
 
void setCursorVisible (bool isVisible)
 Hide or Show the mouse cursor if there is one.
 
void enableRetina (bool enabled)
 Retina support is disabled by default. More...
 
bool isRetinaEnabled () const
 Check whether retina display is enabled. More...
 
int getRetinaFactor () const
 Get retina factor.
 
void setViewName (const std::string viewname)
 
const CCRectgetViewPortRect () const
 Get the opengl view port rectangle. More...
 
bool IsKeyPressed (DWORD nKey)
 return true if the key is being pressed at the time of calling. More...
 
void setFrameSize (float width, float height)
 Set the frame size of EGL view. More...
 
void SetWindowText (const char *pChar)
 set the window title when at windowed mode
 
void FixWindowSize (bool fixed)
 
- Public Member Functions inherited from ParaEngine::IObject
virtual void Clone (IObject *obj) const
 Clone the object's contains to a pointer. More...
 
virtual IObjectClone () const
 Clone the object's contains and return a pointer to the newly created object. More...
 
virtual bool Equals (const IObject *obj) const
 Compare the object with another object. More...
 
virtual const ITypeGetType () const
 
virtual std::string ToString () const
 
WeakPtr_typeGetWeakReference ()
 get weak reference object. More...
 
virtual int ProcessObjectEvent (const ObjectEvent &event)
 this function is only used to backward compatibility of ParaObject:AddEvent() function. More...
 
- Public Member Functions inherited from ParaEngine::CRefCounted
void addref () const
 add reference count of the object. More...
 
bool delref () const
 decrease reference count of the object. More...
 
int GetRefCount () const
 get the reference count
 
virtual int Release ()
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 

Static Public Member Functions

static void setGLContextAttrs (GLContextAttrs &glContextAttrs)
 Static method and member so that we can modify it on all platforms before create OpenGL context. More...
 
static CParaEngineGLViewcreate (const std::string &viewName)
 
static CParaEngineGLViewcreateWithRect (const std::string &viewName, const CCRect &rect, float frameZoomFactor=1.0f)
 
static CParaEngineGLViewcreateWithFullScreen (const std::string &viewName)
 
static CParaEngineGLViewcreateWithFullScreen (const std::string &viewName, const GLFWvidmode &videoMode, GLFWmonitor *monitor)
 

Static Public Attributes

static GLContextAttrs _glContextAttrs = {8, 8, 8, 8, 24, 8}
 The OpenGL context attrs. More...
 

Protected Member Functions

bool initWithRect (const std::string &viewName, const CCRect &rect, float frameZoomFactor)
 
bool initWithFullScreen (const std::string &viewName)
 
bool initWithFullscreen (const std::string &viewname, const GLFWvidmode &videoMode, GLFWmonitor *monitor)
 
bool initGlew ()
 
void updateFrameSize ()
 
void onGLFWError (int errorID, const char *errorDesc)
 
void onGLFWMouseCallBack (GLFWwindow *window, int button, int action, int modify)
 
void onGLFWMouseMoveCallBack (GLFWwindow *window, double x, double y)
 
void onGLFWMouseScrollCallback (GLFWwindow *window, double x, double y)
 
void onGLFWKeyCallback (GLFWwindow *window, int key, int scancode, int action, int mods)
 
void onGLFWCharCallback (GLFWwindow *window, unsigned int character)
 
void onGLFWWindowPosCallback (GLFWwindow *windows, int x, int y)
 
void onGLFWframebuffersize (GLFWwindow *window, int w, int h)
 
void onGLFWWindowSizeFunCallback (GLFWwindow *window, int width, int height)
 
void onGLFWWindowIconifyCallback (GLFWwindow *window, int iconified)
 
const SizegetFrameSize () const
 Get the frame size of EGL view. More...
 

Protected Attributes

GLFWwindow * _mainWindow
 
GLFWmonitor * _monitor
 
bool _isRetinaEnabled
 
bool _isInRetinaMonitor
 
int _retinaFactor
 
bool _captured
 
bool _supportTouch
 
float _mouseX
 
float _mouseY
 
float _frameZoomFactor
 
std::string _viewName
 
Size _screenSize
 
Size _designResolutionSize
 
CCRect _viewPortRect
 
float _scaleX
 
float _scaleY
 
- Protected Attributes inherited from ParaEngine::IObject
WeakPtr_type m_weak_reference
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 

Friends

class GLFWEventHandler
 

Additional Inherited Members

- Public Types inherited from ParaEngine::IObject
typedef ParaEngine::weak_ptr< IObjectWeakPtr_type
 

Member Function Documentation

§ enableRetina()

void ParaEngine::CParaEngineGLView::enableRetina ( bool  enabled)

Retina support is disabled by default.

Note
This method is only available on Mac.

§ getFrameSize()

const Size & ParaEngine::CParaEngineGLView::getFrameSize ( ) const
protected

Get the frame size of EGL view.

In general, it returns the screen size since the EGL view is a fullscreen view.

Returns
The frame size of EGL view.

§ getGLContextAttrs()

const GLContextAttrs& ParaEngine::CParaEngineGLView::getGLContextAttrs ( )

Return the OpenGL context attrs.

Returns
Return the OpenGL context attrs.

§ getViewPortRect()

const CCRect & ParaEngine::CParaEngineGLView::getViewPortRect ( ) const

Get the opengl view port rectangle.

Returns
Return the opengl view port rectangle.

§ IsKeyPressed()

bool ParaEngine::CParaEngineGLView::IsKeyPressed ( DWORD  nKey)

return true if the key is being pressed at the time of calling.

Parameters
nKeya direct input key, such as DIK_SPACE.

§ isRetinaEnabled()

bool ParaEngine::CParaEngineGLView::isRetinaEnabled ( ) const
inline

Check whether retina display is enabled.

§ setFrameSize()

void ParaEngine::CParaEngineGLView::setFrameSize ( float  width,
float  height 
)

Set the frame size of EGL view.

Parameters
widthThe width of the fram size.
heightThe height of the fram size.

§ setGLContextAttrs()

static void ParaEngine::CParaEngineGLView::setGLContextAttrs ( GLContextAttrs glContextAttrs)
static

Static method and member so that we can modify it on all platforms before create OpenGL context.

Parameters
glContextAttrsThe OpenGL context attrs.

Member Data Documentation

§ _glContextAttrs

GLContextAttrs ParaEngine::CParaEngineGLView::_glContextAttrs = {8, 8, 8, 8, 24, 8}
static

The OpenGL context attrs.


The documentation for this class was generated from the following files: