Raito 0.1
Loading...
Searching...
No Matches
OpenGLCore.h
Go to the documentation of this file.
1/*
2MIT License
3
4Copyright (c) 2023 Víctor Falcón Zaro
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in all
14copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22SOFTWARE.
23*/
24#pragma once
25
26#include "OpenGLCommon.h"
28
29namespace Raito::Renderer
30{
31 class Camera;
32}
33
35{
36 bool Initialize();
37 void Shutdown();
38
40
41 NODISCARD Surface CreateSurface(SysWindow* window);
42 void RemoveSurface(u32 id);
43 void ResizeSurface(u32 id, u32 width, u32 height);
46
51
52 void RenderSurface(u32 id);
53
54 u32 AddMesh(Assets::Mesh* mesh);
55 const OpenGLMeshData& GetMesh(u32 id);
56 void RemoveMesh(u32 id);
57
58 u32 AddTexture(Assets::Texture* texture, ubyte* data);
59 void RemoveTexture(u32 id);
60
61 u32 AddMaterial(const Assets::PbrMaterial& material);
62 void SetMaterialValue(u32 id, const Assets::PbrMaterial newMaterial);
63 const Assets::PbrMaterial& GetMaterial(u32 id);
64
65
66 void RemoveMaterial(u32 id);
67
68 void EnableParallax(bool value);
69 bool IsParallaxEnabled();
70
71 void RenderCube();
72 void RenderSphere();
73 void RenderSphereInstanced(u32 count);
74 void RenderCubeInstanced(u32 count);
75
77 void SetTechnique(LightTechnique technique);
78
79 void SetTextureOnShader(const char* name, const OpenGLShader& shader, const Assets::Texture::TextureData& data);
80}
unsigned char ubyte
Unsigned byte type.
Definition BasicTypes.h:31
unsigned __int32 u32
Unsigned integer 32 bit type.
Definition BasicTypes.h:55
#define NODISCARD
Definition Common.h:80
Definition OpenGLCommon.h:47
LightTechnique GetTechnique()
Definition OpenGLCore.cpp:585
void RemoveMesh(u32 id)
Definition OpenGLCore.cpp:475
void Shutdown()
Definition OpenGLCore.cpp:310
u32 SurfaceHeight(u32 id)
Definition OpenGLCore.cpp:388
const OpenGLMeshData & GetMesh(u32 id)
Definition OpenGLCore.cpp:470
u32 AddTexture(Assets::Texture *texture, ubyte *data)
Definition OpenGLCore.cpp:487
u32 GetDeferredBufferAttachment(u32 id)
Definition OpenGLCore.cpp:403
void RenderCube()
Definition OpenGLCore.cpp:602
void RenderSphere()
Definition OpenGLCore.cpp:609
void EnableParallax(bool value)
Definition OpenGLCore.cpp:569
void ResizeSurface(u32 id, u32 width, u32 height)
Definition OpenGLCore.cpp:378
void RenderCubeInstanced(u32 count)
Definition OpenGLCore.cpp:578
u32 GetDeferredBufferDepth()
Definition OpenGLCore.cpp:408
void RenderFullScreenQuad()
Definition OpenGLCore.cpp:345
bool Initialize()
Definition OpenGLCore.cpp:214
bool IsParallaxEnabled()
Definition OpenGLCore.cpp:574
u32 SurfaceWidth(u32 id)
Definition OpenGLCore.cpp:383
void RemoveMaterial(u32 id)
Definition OpenGLCore.cpp:563
u32 AddMesh(Assets::Mesh *mesh)
Definition OpenGLCore.cpp:414
void RenderSphereInstanced(u32 count)
Definition OpenGLCore.cpp:616
void SetTechnique(LightTechnique technique)
Definition OpenGLCore.cpp:590
void SetTextureOnShader(const char *name, const OpenGLShader &shader, const Assets::Texture::TextureData &data)
Definition OpenGLCore.cpp:595
u32 GetDepthAttachment(u32 id)
Definition OpenGLCore.cpp:398
void RenderSurface(u32 id)
Definition OpenGLCore.cpp:279
Surface CreateSurface(SysWindow *window)
Definition OpenGLCore.cpp:353
u32 AddMaterial(const Assets::PbrMaterial &material)
Definition OpenGLCore.cpp:546
void RemoveTexture(u32 id)
Definition OpenGLCore.cpp:535
u32 GetColorAttachment(u32 target, u32 id)
Definition OpenGLCore.cpp:393
void RemoveSurface(u32 id)
Definition OpenGLCore.cpp:373
const Assets::PbrMaterial & GetMaterial(u32 id)
Definition OpenGLCore.cpp:558
void SetMaterialValue(u32 id, const Assets::PbrMaterial newMaterial)
Definition OpenGLCore.cpp:552
Definition Camera.cpp:33
LightTechnique
Definition Renderer.h:119