nngn
|
#include <graphics.h>
Classes | |
struct | BufferConfiguration |
struct | Camera |
struct | DeviceInfo |
struct | Extension |
struct | Layer |
struct | Lighting |
struct | MemoryHeap |
struct | MemoryType |
struct | OpenGLParameters |
struct | Parameters |
struct | PipelineConfiguration |
struct | QueueFamily |
struct | RenderList |
struct | SurfaceInfo |
struct | TerminalParameters |
struct | Version |
struct | VulkanParameters |
Public Types | |
enum class | Backend : u8 { PSEUDOGRAPH , TERMINAL_BACKEND , OPENGL_BACKEND , OPENGL_ES_BACKEND , VULKAN_BACKEND } |
enum class | LogLevel { DEBUG , WARNING , ERROR } |
enum class | PresentMode { IMMEDIATE , MAILBOX , FIFO , FIFO_RELAXED } |
enum class | TerminalFlag : u8 { CLEAR = 1u << 0 , REPOSITION = 1u << 1 , DEDUPLICATE = 1u << 2 , HIDE_CURSOR = 1u << 3 , RESET_COLOR = 1u << 4 } |
enum class | TerminalMode { ASCII , COLORED } |
enum class | CursorMode { NORMAL , HIDDEN , DISABLED } |
using | size_callback_f = void (*)(void*, uvec2) |
using | key_callback_f = void (*)(void*, int, int, int, int) |
using | mouse_button_callback_f = void (*)(void*, int, int, int) |
using | mouse_move_callback_f = void (*)(void*, dvec2) |
Public Member Functions | |
virtual bool | init () |
Fully initialize the back end. | |
virtual bool | init_backend ()=0 |
virtual bool | init_instance ()=0 |
virtual bool | init_device ()=0 |
virtual bool | init_device (std::size_t i)=0 |
virtual std::size_t | n_extensions () const =0 |
virtual std::size_t | n_layers () const =0 |
virtual std::size_t | n_devices () const =0 |
virtual std::size_t | n_device_extensions (std::size_t i) const =0 |
virtual std::size_t | n_queue_families (std::size_t i) const =0 |
virtual std::size_t | n_present_modes () const =0 |
virtual std::size_t | n_heaps (std::size_t i) const =0 |
virtual std::size_t | n_memory_types (std::size_t i, std::size_t ih) const =0 |
virtual std::size_t | selected_device () const =0 |
virtual void | extensions (Extension *p) const =0 |
virtual void | layers (Layer *p) const =0 |
virtual void | device_infos (DeviceInfo *p) const =0 |
virtual void | device_extensions (std::size_t i, Extension *p) const =0 |
virtual void | queue_families (std::size_t i, QueueFamily *p) const =0 |
virtual SurfaceInfo | surface_info () const =0 |
virtual void | present_modes (PresentMode *p) const =0 |
virtual void | heaps (std::size_t i, MemoryHeap *p) const =0 |
virtual void | memory_types (std::size_t i, std::size_t ih, MemoryType *p) const =0 |
virtual bool | error ()=0 |
virtual Version | version () const =0 |
virtual bool | window_closed () const =0 |
virtual int | swap_interval () const =0 |
virtual uvec2 | window_size () const =0 |
virtual GraphicsStats | stats ()=0 |
virtual void | get_keys (size_t n, int32_t *keys) const =0 |
virtual ivec2 | mouse_pos (void) const =0 |
virtual bool | set_n_frames (std::size_t n)=0 |
virtual bool | set_n_swap_chain_images (std::size_t n)=0 |
virtual void | set_swap_interval (int i)=0 |
virtual void | set_window_title (const char *t)=0 |
virtual void | set_cursor_mode (CursorMode m)=0 |
virtual void | set_size_callback (void *data, size_callback_f f)=0 |
virtual void | set_key_callback (void *data, key_callback_f f)=0 |
virtual void | set_mouse_button_callback (void *data, mouse_button_callback_f f)=0 |
virtual void | set_mouse_move_callback (void *data, mouse_move_callback_f f)=0 |
virtual void | resize (int w, int h)=0 |
virtual void | set_camera (const Camera &c)=0 |
virtual void | set_lighting (const Lighting &l)=0 |
virtual void | set_camera_updated ()=0 |
virtual void | set_lighting_updated ()=0 |
virtual bool | set_shadow_map_size (uint32_t s)=0 |
virtual bool | set_shadow_cube_size (uint32_t s)=0 |
virtual void | set_automatic_exposure (bool b)=0 |
virtual void | set_exposure (float e)=0 |
virtual void | set_bloom_downscale (std::size_t d)=0 |
virtual void | set_bloom_threshold (float t)=0 |
virtual void | set_bloom_blur_size (float n)=0 |
virtual void | set_bloom_blur_passes (std::size_t n)=0 |
virtual void | set_bloom_amount (float a)=0 |
virtual void | set_blur_downscale (std::size_t d)=0 |
virtual void | set_blur_size (float n)=0 |
virtual void | set_blur_passes (std::size_t n)=0 |
virtual void | set_HDR_mix (float m)=0 |
virtual u32 | create_pipeline (const PipelineConfiguration &conf)=0 |
virtual u32 | create_buffer (const BufferConfiguration &conf)=0 |
virtual bool | set_buffer_capacity (u32 b, u64 size)=0 |
virtual bool | set_buffer_size (u32 b, std::uint64_t size)=0 |
virtual bool | write_to_buffer (u32 b, u64 offset, u64 n, u64 size, void *data, void f(void *, void *, u64, u64))=0 |
template<typename F > | |
bool | write_to_buffer (u32 b, u64 offset, u64 n, u64 size, F &&f) |
bool | update_buffers (u32 vbo, u32 ebo, u64 voff, u64 eoff, u64 vn, u64 vsize, u64 en, u64 esize, void *data, auto &&vgen, auto &&egen) |
virtual bool | resize_textures (std::uint32_t s)=0 |
virtual bool | load_textures (std::uint32_t i, std::uint32_t n, const std::byte *v)=0 |
virtual bool | resize_font (std::uint32_t s)=0 |
virtual bool | load_font (unsigned char c, std::uint32_t n, const nngn::uvec2 *size, const std::byte *v)=0 |
virtual bool | set_render_list (const RenderList &l)=0 |
virtual void | poll_events () const =0 |
virtual bool | render ()=0 |
virtual bool | vsync ()=0 |
Static Public Member Functions | |
static std::unique_ptr< Graphics > | create (Backend b, const void *params) |
static const char * | enum_str (DeviceInfo::Type t) |
static const char * | enum_str (QueueFamily::Flag f) |
static const char * | enum_str (PresentMode m) |
static const char * | enum_str (MemoryHeap::Flag m) |
static const char * | enum_str (MemoryType::Flag m) |
static std::string | flags_str (QueueFamily::Flag f) |
static std::string | flags_str (MemoryHeap::Flag f) |
static std::string | flags_str (MemoryType::Flag f) |
Static Public Attributes | |
static constexpr u32 | TEXTURE_EXTENT = NNGN_TEXTURE_EXTENT |
static constexpr u32 | TEXTURE_EXTENT_LOG2 = std::countr_zero(TEXTURE_EXTENT) |
static constexpr u32 | TEXTURE_SIZE = NNGN_TEXTURE_SIZE |
static constexpr u32 | TEXTURE_MIP_LEVELS = Math::mip_levels(TEXTURE_EXTENT) |
static constexpr u32 | SHADOW_MAP_INITIAL_SIZE = 1024 |
static constexpr u32 | SHADOW_CUBE_INITIAL_SIZE = 512 |
static constexpr float | DEFAULT_EXPOSURE = 1.0f |
static constexpr float | DEFAULT_BLOOM_THRESHOLD = 0.75f |
static constexpr float | DEFAULT_BLOOM_BLUR_SIZE = 1.0f |
static constexpr std::size_t | DEFAULT_BLOOM_DOWNSCALE = 8 |
static constexpr std::size_t | DEFAULT_BLUR_DOWNSCALE = 2 |
static constexpr std::size_t | DEFAULT_BLOOM_BLUR_PASSES = 10 |
using nngn::Graphics::key_callback_f = void (*)(void*, int, int, int, int) |
using nngn::Graphics::mouse_button_callback_f = void (*)(void*, int, int, int) |
using nngn::Graphics::mouse_move_callback_f = void (*)(void*, dvec2) |
using nngn::Graphics::size_callback_f = void (*)(void*, uvec2) |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{terminal.cpp}::TerminalBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, MapTestGraphics, and nngn::Pseudograph.
|
pure virtual |
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
static |
|
static |
|
static |
|
static |
|
static |
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
static |
|
static |
|
static |
|
pure virtual |
Implemented in nngn::GLFWBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
inlinevirtual |
Fully initialize the back end.
Calls the other initialization functions with default values.
Reimplemented in anonymous_namespace{terminal.cpp}::TerminalBackend.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{vulkan.cpp}::VulkanBackend, nngn::Pseudograph, and TextureTestGraphics.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in nngn::GLFWBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in nngn::GLFWBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
|
pure virtual |
Implemented in anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
|
pure virtual |
Implemented in nngn::GLFWBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{opengl.cpp}::OpenGLBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in nngn::GLFWBackend, and nngn::Pseudograph.
Implemented in anonymous_namespace{vulkan.cpp}::VulkanBackend, nngn::GLFWBackend, and nngn::Pseudograph.
|
pure virtual |
|
pure virtual |
Implemented in nngn::GLFWBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in nngn::GLFWBackend, and nngn::Pseudograph.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Implemented in anonymous_namespace{terminal.cpp}::TerminalBackend, nngn::GLFWBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{terminal.cpp}::TerminalBackend, anonymous_namespace{vulkan.cpp}::VulkanBackend, nngn::GLFWBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in nngn::GLFWBackend, and nngn::Pseudograph.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Implemented in anonymous_namespace{terminal.cpp}::TerminalBackend, nngn::GLFWBackend, and nngn::Pseudograph.
|
inline |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Implemented in nngn::GLFWBackend, and nngn::Pseudograph.
|
pure virtual |
Implemented in anonymous_namespace{terminal.cpp}::TerminalBackend, nngn::GLFWBackend, and nngn::Pseudograph.
bool nngn::Graphics::write_to_buffer | ( | u32 | b, |
u64 | offset, | ||
u64 | n, | ||
u64 | size, | ||
F && | f ) |
|
static |
|
static |
|
staticconstexpr |
|
static |
|
staticconstexpr |
|
static |
|
static |
|
staticconstexpr |
|
static |
|
static |
|
static |