⚠️ This documentation corresponds to the latest development branch of axmol. It might diverge from the official releases.
Axmol Engine 2.4.0-ce063c5
|
By GLView you can operate the frame information of EGL view through some function. More...
#include <GLView.h>
Inherits Object.
Public Member Functions | |
GLView () | |
@js ctor | |
virtual | ~GLView () |
@js NA @lua NA | |
virtual void | end ()=0 |
Force destroying EGL view, subclass must implement this method. | |
virtual bool | isOpenGLReady ()=0 |
Get whether opengl render system is ready, subclass must implement this method. | |
virtual void | swapBuffers ()=0 |
Exchanges the front and back buffers, subclass must implement this method. | |
virtual void | setIMEKeyboardState (bool open)=0 |
Open or close IME keyboard , subclass must implement this method. | |
virtual bool | windowShouldClose () |
When the window is closed, it will return false if the platforms is Ios or Android. | |
virtual void | pollEvents () |
Polls the events. | |
virtual Vec2 | getFrameSize () const |
Get the frame size of EGL view. | |
virtual void | setFrameSize (float width, float height) |
Set the frame size of EGL view. | |
virtual void | setFrameZoomFactor (float) |
Set zoom factor for frame. | |
virtual float | getFrameZoomFactor () const |
Get zoom factor for frame. | |
virtual void | setCursorVisible (bool) |
Hide or Show the mouse cursor if there is one. | |
virtual int | getRetinaFactor () const |
Get retina factor. | |
virtual bool | setContentScaleFactor (float) |
Only works on ios platform. | |
virtual float | getContentScaleFactor () const |
Only works on ios platform. | |
virtual bool | isRetinaDisplay () const |
Returns whether or not the view is in Retina Display mode. | |
virtual Vec2 | getVisibleSize () const |
Get the visible area size of opengl viewport. | |
virtual Vec2 | getVisibleOrigin () const |
Get the visible origin point of opengl viewport. | |
virtual Rect | getVisibleRect () const |
Get the visible rectangle of opengl viewport. | |
virtual Rect | getSafeAreaRect () const |
Gets safe area rectangle. | |
virtual void | setDesignResolutionSize (float width, float height, ResolutionPolicy resolutionPolicy) |
Set the design resolution size. | |
virtual const Vec2 & | getDesignResolutionSize () const |
Get design resolution size. | |
virtual void | setViewPortInPoints (float x, float y, float w, float h) |
Set opengl view port rectangle with points. | |
virtual void | setScissorInPoints (float x, float y, float w, float h) |
Set Scissor rectangle with points. | |
virtual bool | isScissorEnabled () |
Get whether GL_SCISSOR_TEST is enable. | |
virtual Rect | getScissorRect () const |
Get the current scissor rectangle. | |
virtual void | setViewName (std::string_view viewname) |
Set the view name. | |
std::string_view | getViewName () const |
Get the view name. | |
virtual void | handleTouchesBegin (int num, intptr_t ids[], float xs[], float ys[]) |
Touch events are handled by default; if you want to customize your handlers, please override this function. | |
virtual void | handleTouchesMove (int num, intptr_t ids[], float xs[], float ys[]) |
Touch events are handled by default; if you want to customize your handlers, please override this function. | |
virtual void | handleTouchesMove (int num, intptr_t ids[], float xs[], float ys[], float fs[], float ms[]) |
Touch events are handled by default; if you want to customize your handlers, please override this function. | |
virtual void | handleTouchesEnd (int num, intptr_t ids[], float xs[], float ys[]) |
Touch events are handled by default; if you want to customize your handlers, please override this function. | |
virtual void | handleTouchesCancel (int num, intptr_t ids[], float xs[], float ys[]) |
Touch events are handled by default; if you want to customize your handlers, please override this function. | |
virtual void | setIcon (std::string_view filename) const |
Set window icon (implemented for windows and linux). | |
virtual void | setIcon (const std::vector< std::string_view > &filelist) const |
Set window icon (implemented for windows and linux). | |
virtual void | setDefaultIcon () const |
Set default window icon (implemented for windows and linux). | |
const Rect & | getViewPortRect () const |
Get the opengl view port rectangle. | |
std::vector< Touch * > | getAllTouches () const |
Get list of all active touches. | |
float | getScaleX () const |
Get scale factor of the horizontal direction. | |
float | getScaleY () const |
Get scale factor of the vertical direction. | |
ResolutionPolicy | getResolutionPolicy () const |
Returns the current Resolution policy. | |
void | renderScene (Scene *scene, Renderer *renderer) |
Renders a Scene with a Renderer This method is called directly by the Director. | |
![]() | |
void | retain () |
Retains the ownership. | |
void | release () |
Releases the ownership immediately. | |
Object * | autorelease () |
Releases the ownership sometime soon automatically. | |
unsigned int | getReferenceCount () const |
Returns the Object's current reference count. | |
virtual | ~Object () |
Destructor. | |
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. | |
static GLContextAttrs | getGLContextAttrs () |
Return the OpenGL context attrs. | |
Static Public Attributes | |
static GLContextAttrs | _glContextAttrs |
The OpenGL context attrs. | |
Additional Inherited Members | |
![]() | |
unsigned int | _ID |
object id, ScriptSupport need public _ID | |
int | _luaID |
Lua reference id. | |
By GLView you can operate the frame information of EGL view through some function.
|
pure virtual |
Force destroying EGL view, subclass must implement this method.
@lua endToLua
|
pure virtual |
Open or close IME keyboard , subclass must implement this method.
open | Open or close IME keyboard. |
|
inlinevirtual |
When the window is closed, it will return false if the platforms is Ios or Android.
If the platforms is windows or Mac,it will return true.
|
static |
Static method and member so that we can modify it on all platforms before create OpenGL context.
glContextAttrs | The OpenGL context attrs. |
|
static |
Return the OpenGL context attrs.
|
virtual |
Get the frame size of EGL view.
In general, it returns the screen size since the EGL view is a fullscreen view.
|
virtual |
Set the frame size of EGL view.
width | The width of the fram size. |
height | The height of the fram size. |
|
inlinevirtual |
Set zoom factor for frame.
This methods are for debugging big resolution (e.g.new ipad) app on desktop.
zoomFactor | The zoom factor for frame. |
|
inlinevirtual |
Get zoom factor for frame.
This methods are for debugging big resolution (e.g.new ipad) app on desktop.
|
inlinevirtual |
|
inlinevirtual |
Get retina factor.
|
inlinevirtual |
Only works on ios platform.
Set Content Scale of the Factor.
|
inlinevirtual |
Only works on ios platform.
Get Content Scale of the Factor.
|
inlinevirtual |
Returns whether or not the view is in Retina Display mode.
|
virtual |
Get the visible area size of opengl viewport.
|
virtual |
Get the visible origin point of opengl viewport.
|
virtual |
Get the visible rectangle of opengl viewport.
|
virtual |
Set the design resolution size.
width | Design resolution width. |
height | Design resolution height. |
resolutionPolicy | The resolution policy desired, you may choose: [1] EXACT_FIT Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched. [2] NO_BORDER Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut. [3] SHOW_ALL Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown. |
|
virtual |
Get design resolution size.
Default resolution size is the same as 'getFrameSize'.
|
virtual |
Set opengl view port rectangle with points.
x | Set the points of x. |
y | Set the points of y. |
w | Set the width of the view port |
h | Set the Height of the view port. |
|
virtual |
Set Scissor rectangle with points.
x | Set the points of x. |
y | Set the points of y. |
w | Set the width of the view port |
h | Set the Height of the view port. |
|
virtual |
Get whether GL_SCISSOR_TEST is enable.
|
virtual |
Get the current scissor rectangle.
|
virtual |
Set the view name.
viewname | A string will be set to the view as name. |
std::string_view getViewName | ( | ) | const |
Get the view name.
|
virtual |
Touch events are handled by default; if you want to customize your handlers, please override this function.
num | The number of touch. |
ids | The identity of the touch. |
xs | The points of x. |
ys | The points of y. |
|
virtual |
Touch events are handled by default; if you want to customize your handlers, please override this function.
num | The number of touch. |
ids | The identity of the touch. |
xs | The points of x. |
ys | The points of y. |
|
virtual |
Touch events are handled by default; if you want to customize your handlers, please override this function.
num | The number of touch. |
ids | The identity of the touch. |
xs | The points of x. |
ys | The points of y. |
fs | The force of 3d touches. |
ms | The maximum force of 3d touches |
|
virtual |
Touch events are handled by default; if you want to customize your handlers, please override this function.
num | The number of touch. |
ids | The identity of the touch. |
xs | The points of x. |
ys | The points of y. |
|
virtual |
Touch events are handled by default; if you want to customize your handlers, please override this function.
num | The number of touch. |
ids | The identity of the touch. |
xs | The points of x. |
ys | The points of y. |
|
inlinevirtual |
Set window icon (implemented for windows and linux).
filename | A path to image file, e.g., "icons/cusom.png". |
|
inlinevirtual |
Set window icon (implemented for windows and linux).
Best icon (based on size) will be auto selected.
filelist | The array contains icons. |
|
inlinevirtual |
Set default window icon (implemented for windows and linux).
On windows it will use icon from .exe file (if included). On linux it will use default window icon.
const Rect & getViewPortRect | ( | ) | const |
Get the opengl view port rectangle.
std::vector< Touch * > getAllTouches | ( | ) | const |
Get list of all active touches.
float getScaleX | ( | ) | const |
Get scale factor of the horizontal direction.
float getScaleY | ( | ) | const |
Get scale factor of the vertical direction.
|
inline |
Returns the current Resolution policy.