2014-03-10 14:04:58 +08:00
--------------------------------
-- @module GLView
2014-08-01 15:53:19 +08:00
-- @extend Ref
2014-06-25 17:36:50 +08:00
-- @parent_module cc
2014-03-18 15:55:30 +08:00
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Set the frame size of EGL view.<br>
-- param width The width of the fram size.<br>
-- param height The height of the fram size.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] setFrameSize
2014-03-10 14:04:58 +08:00
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float width
-- @param #float height
2015-01-21 17:33:26 +08:00
-- @return GLView#GLView self (return value: cc.GLView)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Get the opengl view port rectangle.<br>
-- return Return the opengl view port rectangle.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getViewPortRect
2014-03-10 14:04:58 +08:00
-- @param self
2014-08-01 15:53:19 +08:00
-- @return rect_table#rect_table ret (return value: rect_table)
2014-03-10 14:04:58 +08:00
2014-08-12 10:08:16 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Only works on ios platform. Set Content Scale of the Factor.
2014-08-12 10:08:16 +08:00
-- @function [parent=#GLView] setContentScaleFactor
-- @param self
2016-11-09 17:33:47 +08:00
-- @param #float
2014-08-12 10:08:16 +08:00
-- @return bool#bool ret (return value: bool)
2014-03-10 14:04:58 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Only works on ios platform. Get Content Scale of the Factor.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getContentScaleFactor
2014-03-10 14:04:58 +08:00
-- @param self
2014-08-01 15:53:19 +08:00
-- @return float#float ret (return value: float)
2014-03-10 14:04:58 +08:00
2014-03-18 15:55:30 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Open or close IME keyboard , subclass must implement this method. <br>
-- param open Open or close IME keyboard.
2014-03-18 15:55:30 +08:00
-- @function [parent=#GLView] setIMEKeyboardState
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #bool open
2015-01-21 17:33:26 +08:00
-- @return GLView#GLView self (return value: cc.GLView)
2014-03-18 15:55:30 +08:00
2017-11-23 16:06:18 +08:00
--------------------------------
-- Gets safe area rectangle
-- @function [parent=#GLView] getSafeAreaRect
-- @param self
-- @return rect_table#rect_table ret (return value: rect_table)
2016-06-17 10:22:58 +08:00
--------------------------------
--
-- @function [parent=#GLView] getVR
-- @param self
-- @return VRIRenderer#VRIRenderer ret (return value: cc.VRIRenderer)
2014-08-01 15:53:19 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Set Scissor rectangle with points.<br>
-- param x Set the points of x.<br>
-- param y Set the points of y.<br>
-- param w Set the width of the view port<br>
-- param h Set the Height of the view port.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] setScissorInPoints
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float x
-- @param #float y
-- @param #float w
-- @param #float h
2015-01-21 17:33:26 +08:00
-- @return GLView#GLView self (return value: cc.GLView)
2014-08-01 15:53:19 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Get the view name.<br>
-- return The view name.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getViewName
-- @param self
-- @return string#string ret (return value: string)
2014-03-18 15:55:30 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- Get whether opengl render system is ready, subclass must implement this method.
2014-03-18 15:55:30 +08:00
-- @function [parent=#GLView] isOpenGLReady
-- @param self
-- @return bool#bool ret (return value: bool)
2015-03-16 14:53:18 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Hide or Show the mouse cursor if there is one.<br>
-- param isVisible Hide or Show the mouse cursor if there is one.
2015-03-16 14:53:18 +08:00
-- @function [parent=#GLView] setCursorVisible
-- @param self
2016-11-09 17:33:47 +08:00
-- @param #bool
2015-03-16 14:53:18 +08:00
-- @return GLView#GLView self (return value: cc.GLView)
2014-08-01 15:53:19 +08:00
--------------------------------
2016-06-16 10:58:46 +08:00
-- Get the frame size of EGL view.<br>
-- In general, it returns the screen size since the EGL view is a fullscreen view.<br>
-- return The frame size of EGL view.
-- @function [parent=#GLView] getFrameSize
2014-08-01 15:53:19 +08:00
-- @param self
2016-06-16 10:58:46 +08:00
-- @return size_table#size_table ret (return value: size_table)
2014-08-01 15:53:19 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Get scale factor of the vertical direction.<br>
-- return Scale factor of the vertical direction.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getScaleY
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2015-03-23 22:37:03 +08:00
-- Get scale factor of the horizontal direction.<br>
-- return Scale factor of the horizontal direction.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getScaleX
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2015-03-23 22:37:03 +08:00
-- Get the visible origin point of opengl viewport.<br>
-- return The visible origin point of opengl viewport.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getVisibleOrigin
-- @param self
-- @return vec2_table#vec2_table ret (return value: vec2_table)
2014-08-12 10:08:16 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Set zoom factor for frame. This methods are for<br>
-- debugging big resolution (e.g.new ipad) app on desktop.<br>
-- param zoomFactor The zoom factor for frame.
2014-08-12 10:08:16 +08:00
-- @function [parent=#GLView] setFrameZoomFactor
-- @param self
2016-11-09 17:33:47 +08:00
-- @param #float
2015-01-21 17:33:26 +08:00
-- @return GLView#GLView self (return value: cc.GLView)
2014-08-12 10:08:16 +08:00
2014-08-01 15:53:19 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Get zoom factor for frame. This methods are for<br>
-- debugging big resolution (e.g.new ipad) app on desktop.<br>
-- return The zoom factor for frame.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getFrameZoomFactor
-- @param self
-- @return float#float ret (return value: float)
--------------------------------
2014-09-02 13:45:07 +08:00
-- Get design resolution size.<br>
2015-03-23 22:37:03 +08:00
-- Default resolution size is the same as 'getFrameSize'.<br>
-- return The design resolution size.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getDesignResolutionSize
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
2015-03-23 22:37:03 +08:00
-- When the window is closed, it will return false if the platforms is Ios or Android.<br>
-- If the platforms is windows or Mac,it will return true.<br>
-- return In ios and android it will return false,if in windows or Mac it will return true.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] windowShouldClose
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
2014-09-02 13:45:07 +08:00
-- Exchanges the front and back buffers, subclass must implement this method.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] swapBuffers
-- @param self
2015-01-21 17:33:26 +08:00
-- @return GLView#GLView self (return value: cc.GLView)
2014-08-01 15:53:19 +08:00
--------------------------------
2014-09-02 13:45:07 +08:00
-- Set the design resolution size.<br>
-- param width Design resolution width.<br>
-- param height Design resolution height.<br>
-- param resolutionPolicy The resolution policy desired, you may choose:<br>
-- [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.<br>
-- [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.<br>
-- [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.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] setDesignResolutionSize
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float width
-- @param #float height
-- @param #int resolutionPolicy
2015-01-21 17:33:26 +08:00
-- @return GLView#GLView self (return value: cc.GLView)
2014-08-01 15:53:19 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Returns the current Resolution policy.<br>
-- return The current Resolution policy.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getResolutionPolicy
-- @param self
-- @return int#int ret (return value: int)
2016-06-16 10:58:46 +08:00
--------------------------------
-- Force destroying EGL view, subclass must implement this method. <br>
-- lua endToLua
-- @function [parent=#GLView] end
-- @param self
-- @return GLView#GLView self (return value: cc.GLView)
2014-08-01 15:53:19 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Returns whether or not the view is in Retina Display mode.<br>
-- return Returns whether or not the view is in Retina Display mode.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] isRetinaDisplay
-- @param self
-- @return bool#bool ret (return value: bool)
2016-06-17 10:22:58 +08:00
--------------------------------
-- Renders a Scene with a Renderer<br>
2016-06-22 13:52:51 +08:00
-- This method is called directly by the Director
2016-06-17 10:22:58 +08:00
-- @function [parent=#GLView] renderScene
-- @param self
-- @param #cc.Scene scene
-- @param #cc.Renderer renderer
-- @return GLView#GLView self (return value: cc.GLView)
--------------------------------
-- Sets a VR renderer. <br>
-- if `vrrenderer` is `nullptr` VR will be disabled
-- @function [parent=#GLView] setVR
-- @param self
-- @param #cc.VRIRenderer vrrenderer
-- @return GLView#GLView self (return value: cc.GLView)
2014-08-01 15:53:19 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Set opengl view port rectangle with points.<br>
-- param x Set the points of x.<br>
-- param y Set the points of y.<br>
-- param w Set the width of the view port<br>
-- param h Set the Height of the view port.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] setViewPortInPoints
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #float x
-- @param #float y
-- @param #float w
-- @param #float h
2015-01-21 17:33:26 +08:00
-- @return GLView#GLView self (return value: cc.GLView)
2014-08-01 15:53:19 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Get the current scissor rectangle.<br>
-- return The current scissor rectangle.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getScissorRect
-- @param self
-- @return rect_table#rect_table ret (return value: rect_table)
--------------------------------
2015-03-23 22:37:03 +08:00
-- Get retina factor.<br>
-- return The retina factor.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getRetinaFactor
-- @param self
-- @return int#int ret (return value: int)
--------------------------------
2015-03-23 22:37:03 +08:00
-- Set the view name. <br>
-- param viewname A string will be set to the view as name.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] setViewName
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #string viewname
2015-01-21 17:33:26 +08:00
-- @return GLView#GLView self (return value: cc.GLView)
2014-08-01 15:53:19 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Get the visible rectangle of opengl viewport.<br>
-- return The visible rectangle of opengl viewport.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getVisibleRect
-- @param self
-- @return rect_table#rect_table ret (return value: rect_table)
--------------------------------
2015-03-23 22:37:03 +08:00
-- Get the visible area size of opengl viewport.<br>
-- return The visible area size of opengl viewport.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] getVisibleSize
-- @param self
-- @return size_table#size_table ret (return value: size_table)
--------------------------------
2015-03-23 22:37:03 +08:00
-- Get whether GL_SCISSOR_TEST is enable.<br>
-- return Whether GL_SCISSOR_TEST is enable.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] isScissorEnabled
-- @param self
-- @return bool#bool ret (return value: bool)
--------------------------------
2015-03-23 22:37:03 +08:00
-- Polls the events.
2014-08-01 15:53:19 +08:00
-- @function [parent=#GLView] pollEvents
-- @param self
2015-01-21 17:33:26 +08:00
-- @return GLView#GLView self (return value: cc.GLView)
2014-08-01 15:53:19 +08:00
2014-08-25 10:34:32 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Static method and member so that we can modify it on all platforms before create OpenGL context. <br>
-- param glContextAttrs The OpenGL context attrs.
2014-08-25 10:34:32 +08:00
-- @function [parent=#GLView] setGLContextAttrs
-- @param self
2014-09-02 13:45:07 +08:00
-- @param #GLContextAttrs glContextAttrs
2015-01-21 17:33:26 +08:00
-- @return GLView#GLView self (return value: cc.GLView)
2014-08-25 10:34:32 +08:00
--------------------------------
2015-03-23 22:37:03 +08:00
-- Return the OpenGL context attrs. <br>
-- return Return the OpenGL context attrs.
2014-08-25 10:34:32 +08:00
-- @function [parent=#GLView] getGLContextAttrs
-- @param self
-- @return GLContextAttrs#GLContextAttrs ret (return value: GLContextAttrs)
2014-03-10 14:04:58 +08:00
return nil