|
Gamp v0.0.8
Gamp: Graphics, Audio, Multimedia and Processing
|
#include <Surface.hpp>
Classes | |
| struct | Private |
Public Types | |
| enum class | lock_status_t : uint16_t { unlocked , not_ready , locked_changed , locked_same } |
Public Member Functions | |
| Surface (const Surface &)=delete | |
| Surface (Private, handle_t surface_handle, const Vec2i &surface_size, const Capabilities &requested) | |
| Private ctor for single Surface::create() method w/o public ctor. | |
| virtual | ~Surface () noexcept |
| Releases this instance. | |
| const Capabilities * | capabilities () const noexcept |
| Returns the chosen (retrieved) capabilities of a realized surface. | |
| bool | createContext (const gamp::render::RenderProfile &profile, const gamp::render::RenderContextFlags &contextFlags) |
| virtual void | dispose (const jau::fraction_timespec &) noexcept |
| virtual void | disposedNotify (const jau::fraction_timespec &) noexcept |
| constexpr bool | isBLOriented () const noexcept |
Returns true if this surface is rendered in OpenGL's coordinate system, origin at bottom left. | |
| virtual bool | isValid () const noexcept |
| lock_status_t | lockSurface () |
| Lock the surface of this native window. | |
| void | operator= (const Surface &)=delete |
| const gamp::render::RenderContext * | renderContext () const noexcept |
| gamp::render::RenderContext * | renderContext () noexcept |
| void | setRequestedCapabilities (CapabilitiesPtr &&req) noexcept |
| Sets the requested capabilities for a surface to be realized. | |
| bool | setSwapInterval (int v) noexcept |
| Returns true if swap interval could be set with the native toolkit post createContext(). | |
| const SurfaceSRef | shared () |
| constexpr handle_t | surfaceHandle () const noexcept |
| Returns the handle to the surface for this NativeSurface. | |
| constexpr const Vec2i & | surfaceSize () const noexcept |
| Returns the surface size of the client area excluding insets (window decorations) in pixel units. | |
| virtual bool | surfaceSwap () noexcept |
| Provide a mechanism to utilize custom (pre-) swap surface code. | |
| constexpr int | swapInterval () const noexcept |
| Returns desired or determined swap interval. | |
| std::string | toString () const noexcept |
| void | unlockSurface () |
| Unlock the surface of this native window. | |
Static Public Member Functions | |
| static SurfaceSRef | create (handle_t surface_handle, const Vec2i &surface_size, const Capabilities &requested) |
| static gamp::render::RenderContextPtr | createContext (const wt::SurfaceSRef &surface, const gamp::render::RenderProfile &profile, const gamp::render::RenderContextFlags &contextFlags, gamp::render::RenderContext *shareWith) noexcept |
| static constexpr bool | is_locked (const lock_status_t ls) noexcept |
Static Public Attributes | |
| static constexpr const jau::fraction_i64 | TIMEOUT = 5_s |
Protected Member Functions | |
| virtual lock_status_t | nativeSurfaceLock () noexcept |
| virtual void | nativeSurfaceUnlock () noexcept |
| void | setSurfaceSize (const Vec2i &sz) noexcept |
| template<typename ChildT> | |
| std::shared_ptr< ChildT > | shared_from_base () |
Static Protected Member Functions | |
| static void | setCaps (handle_t surface_handle, const Capabilities &requested) noexcept |
Definition at line 38 of file Surface.hpp.
|
strong |
| Enumerator | |
|---|---|
| unlocked | |
| not_ready | |
| locked_changed | |
| locked_same | |
Definition at line 42 of file Surface.hpp.
|
inline |
Private ctor for single Surface::create() method w/o public ctor.
Definition at line 81 of file Surface.hpp.
|
delete |
|
inlinevirtualnoexcept |
Releases this instance.
Definition at line 94 of file Surface.hpp.
|
inlinestaticconstexprnoexcept |
|
staticprotectednoexcept |
|
inlineprotected |
|
inlineprotectednoexcept |
Definition at line 74 of file Surface.hpp.
|
inlineprotectedvirtualnoexcept |
|
inlineprotectedvirtualnoexcept |
Definition at line 77 of file Surface.hpp.
|
inlinestatic |
Definition at line 84 of file Surface.hpp.
|
delete |
|
inlinevirtualnoexcept |
Reimplemented in gamp::wt::Window.
Definition at line 100 of file Surface.hpp.
|
inlinevirtualnoexcept |
Reimplemented in gamp::wt::Window.
Definition at line 104 of file Surface.hpp.
|
inline |
|
inline |
|
staticnoexcept |
Definition at line 125 of file gamp_sdl2_gl.cpp.
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 134 of file Surface.hpp.
|
inlinenoexcept |
Returns the chosen (retrieved) capabilities of a realized surface.
Definition at line 139 of file Surface.hpp.
|
inlinenoexcept |
Sets the requested capabilities for a surface to be realized.
Definition at line 142 of file Surface.hpp.
|
inlineconstexprnoexcept |
Returns desired or determined swap interval.
Defaults to -1, i.e. adaptive swap interval.
Use setSwapInterval() to set the swap interval.
Definition at line 153 of file Surface.hpp.
|
inlinenoexcept |
Returns true if swap interval could be set with the native toolkit post createContext().
See swapInterval().
Definition at line 156 of file Surface.hpp.
|
inlineconstexprnoexcept |
Returns true if this surface is rendered in OpenGL's coordinate system, origin at bottom left.
Otherwise returns false, i.e. origin at top left.
Default impl. is true, i.e. OpenGL bottom-left coordinate system.
Currently only MS-Windows bitmap offscreen drawable uses a non OpenGL orientation and hence returns false.
This removes the need of a vertical flip when used in AWT or Windows applications.
Definition at line 174 of file Surface.hpp.
|
inlineconstexprnoexcept |
Returns the surface size of the client area excluding insets (window decorations) in pixel units.
Definition at line 177 of file Surface.hpp.
|
inlineconstexprnoexcept |
Returns the handle to the surface for this NativeSurface.
The surface handle should be set/update by lockSurface(), where unlockSurface() is not allowed to modify it. After unlockSurface() it is no more guaranteed that the surface handle is still valid.
The surface handle shall reflect the platform one for all drawable surface operations, e.g. opengl, swap-buffer.
On X11 this returns an entity of type Window, since there is no differentiation of surface and window there.
On Microsoft Windows this returns an entity of type HDC.
Definition at line 194 of file Surface.hpp.
|
inlinevirtualnoexcept |
Reimplemented in gamp::wt::Window.
Definition at line 196 of file Surface.hpp.
|
inlinevirtualnoexcept |
Provide a mechanism to utilize custom (pre-) swap surface code.
This method is called before the render toolkit (e.g. JOGL) swaps the buffer/surface if double buffering is enabled.
The implementation may itself apply the swapping, in which case true shall be returned.
Reimplemented in gamp::wt::Window.
Definition at line 210 of file Surface.hpp.
|
inline |
Lock the surface of this native window.
The surface handle shall be valid after a successfull call, i.e. return a value other than lock_status_t::unlocked and lock_status_t::not_ready.
The caller may need to take care of the result lock_status_t::locked_changed, where the surface handle is valid but has changed.
This call is blocking until the surface has been locked or a timeout is reached. The latter will throw a runtime exception.
This call allows recursion from the same thread.
The implementation may want to aquire the application level com.jogamp.common.util.locks.RecursiveLock first before proceeding with a native surface lock.
The implementation shall also invoke AbstractGraphicsDevice#lock() for the initial lock (recursive count zero).
| RuntimeException | after timeout when waiting for the surface lock |
| NativeWindowException | if native locking failed, maybe platform related |
Definition at line 238 of file Surface.hpp.
|
inline |
Unlock the surface of this native window.
Shall not modify the surface handle, see lockSurface().
The implementation shall also invoke GraphicsDevice::unlock() for the final unlock (recursive count zero).
The implementation shall be fail safe, i.e. tolerant in case the native resources are already released / unlocked. In this case the implementation shall simply ignore the call.
Definition at line 266 of file Surface.hpp.
|
inlinenoexcept |
|
staticconstexpr |
Definition at line 40 of file Surface.hpp.