|
Axmol 3.0.0-89d6d9a
|
Core render view abstraction for window/surface state and scene presentation. More...
#include <RenderViewCore.h>
Inherits Object.
Public Member Functions | |
| virtual | ~RenderViewCore () |
| @lua NA | |
| virtual void | end ()=0 |
| Force destroying EGL view, subclass must implement this method. | |
| virtual bool | isGfxContextReady ()=0 |
| Get whether graphics context 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. | |
| void | pollEvents () |
| Polls compositor-managed events before scheduler update. | |
| const Vec2 & | getWindowSize () const |
| Get the zoomed window size In general, it returns the screen size since the view is a fullscreen view. | |
| virtual void | setWindowSize (float, float) |
| Set the zoomed window size. | |
| virtual void | setWindowZoomFactor (float) |
| Set zoom factor for frame. | |
| virtual float | getWindowZoomFactor () const |
| Get zoom factor for frame. | |
| AX_DEPRECATED ("3.0") const Vec2 &getFrameSize() const | |
| implicit deprecated APIs, use getWindowSize instead | |
| virtual void | setCursorVisible (bool) |
| Hide or Show the mouse cursor if there is one. | |
| float | getRenderScale () const |
| Get axmol render scale. | |
| virtual Vec2 | getVisibleSize () const |
| Get the visible area size of render viewport. | |
| virtual Vec2 | getVisibleOrigin () const |
| Get the visible origin point of render viewport. | |
| virtual Rect | getVisibleRect () const |
| Get the visible rectangle of render 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 render 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 | getScissorInPoints () const |
| Get the current scissor rectangle. | |
| std::string_view | getViewName () const |
| Get the view name. | |
| virtual void | setIcon (std::string_view) const |
| Set window icon (implemented for windows and linux). | |
| virtual void | setIcon (std::span< const std::string_view >) 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 render view port rectangle. | |
| 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. | |
| virtual void * | getNativeWindow () const |
| Get the Native Window object. | |
| virtual SurfaceHandle | getNativeDisplay () const |
| Get the Native Display object. | |
| virtual WindowPlatform | getWindowPlatform () const |
| Get the Window Platform object. | |
| virtual void | showContextMenu (const Vec2 &, bool hasText, bool hasSelection, bool readOnly) |
| Show the system edit menu (Copy/Cut/Paste) at the given point. | |
| virtual void | hideContextMenu () |
| Hide the system edit menu if visible. | |
| void | updateRenderSurface (float width, float height, uint8_t updateFlag) |
| Updates the render surface size (framebuffer/render target) and synchronizes related view parameters. | |
| void | setSceneCompositor (std::unique_ptr< SceneCompositor > &&compositor) |
| Replaces the active scene compositor. | |
| Public Member Functions inherited from Object | |
| 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. | |
| uint64_t | getObjectID () const noexcept |
| Returns the process-local diagnostic identifier assigned at construction. | |
| virtual | ~Object () |
| Destructor. | |
Core render view abstraction for window/surface state and scene presentation.
RenderViewCore owns the active SceneCompositor, tracks window and render surface sizes, maintains design-resolution viewport mapping, and forwards scene rendering, scissor operations, and per-frame event polling to the active compositor.
Platform subclasses provide native window/event/swapchain behavior.
|
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.
| void pollEvents | ( | ) |
Polls compositor-managed events before scheduler update.
The active SceneCompositor decides how native platform events and optional runtime events are polled. The default compositor forwards to pollNativeEvents().
|
inline |
Get the zoomed window size In general, it returns the screen size since the view is a fullscreen view.
|
inlinevirtual |
Set the zoomed window size.
| 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 |
|
inline |
Get axmol render scale.
Notes:
|
virtual |
Get the visible area size of render viewport.
|
virtual |
Get the visible origin point of render viewport.
|
virtual |
Get the visible rectangle of render 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 'getWindowSize'.
|
virtual |
Set render 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.
| std::string_view getViewName | ( | ) | const |
Get the view name.
|
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 render view port rectangle.
|
inline |
Get scale factor of the horizontal direction.
|
inline |
Get scale factor of the vertical direction.
|
inline |
Returns the current Resolution policy.
|
inlinevirtual |
Get the Native Window object.
|
inlinevirtual |
Get the Native Display object.
|
inlinevirtual |
Get the Window Platform object.
|
inlinevirtual |
Show the system edit menu (Copy/Cut/Paste) at the given point.
The point is specified in screen coordinates (engine pixels), not platform view points. Callers that have platform view coordinates must convert by dividing by the view's content scale factor before calling.
This method must be called on the main/UI thread. Implementations should present the platform's standard edit menu at the requested location and route menu actions back to the engine (e.g. via InputSystem).
| screenPoint | Target location in screen coordinates. |
| hasSelection | Whether there is a text selection. |
| hasText | Whether the input field has text. |
| readOnly | Whether the current input field is read-only |
|
inlinevirtual |
Hide the system edit menu if visible.
Must be safe to call on the main/UI thread. Implementations should dismiss any visible system edit menu.
| void updateRenderSurface | ( | float | width, |
| float | height, | ||
| uint8_t | updateFlag ) |
Updates the render surface size (framebuffer/render target) and synchronizes related view parameters.
This method performs the following actions:
| width | The target width of the render surface. Its meaning depends on updateFlag: it may represent the framebuffer width, logical window width, or design resolution width. |
| height | The target height of the render surface. Its meaning depends on updateFlag: it may represent the framebuffer height, logical window height, or design resolution height. |
| updateFlag | Optional flags to control which parts of the view should be updated. Defaults to SurfaceUpdateFlag::AllUpdates. |
| void setSceneCompositor | ( | std::unique_ptr< SceneCompositor > && | compositor | ) |
Replaces the active scene compositor.
Pass nullptr to restore the default SceneCompositor. The new compositor is immediately bound to this RenderViewCore via SceneCompositor::onRenderViewChanged(). The previous compositor is destroyed synchronously.
| compositor | New compositor, or nullptr for the default compositor. |