YourGameLib
Loading...
Searching...
No Matches
drawing.h
Go to the documentation of this file.
1/*
2Copyright (c) 2019-2024 Alexander Scholz
3
4This software is provided 'as-is', without any express or implied
5warranty. In no event will the authors be held liable for any damages
6arising from the use of this software.
7
8Permission is granted to anyone to use this software for any purpose,
9including commercial applications, and to alter it and redistribute it
10freely, subject to the following restrictions:
11
121. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
162. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
183. This notice may not be removed or altered from any source distribution.
19*/
20#ifndef YOURGAME_GLDRAWING_H
21#define YOURGAME_GLDRAWING_H
22
23#include <array>
24#include <vector>
26#include "yourgame/math/trafo.h"
28#include "yourgame/gl/shader.h"
29#include "yourgame/gl/texture.h"
30
31namespace yourgame
32{
33 namespace gl
34 {
36 {
39 glm::mat4 modelMat = glm::mat4(1);
40 std::vector<yourgame::gl::Texture *> textures = {};
41 std::array<float, 4> subtex = {0.0f, 1.0f, 0.0f, 1.0f};
42 GLsizei instancecount = 1;
43 };
44
45 void drawGeo(const yourgame::gl::Geometry *geo, const yourgame::gl::DrawConfig &cfg);
46
47 std::array<float, 4> drawSprite(yourgame::gl::Texture *texture,
48 const yourgame::gl::TextureCoords &coords,
49 float x,
50 float y,
51 float width,
52 float height,
53 float angle);
54
55 void drawSky(yourgame::gl::Texture *texture,
57 std::array<float, 3> tint,
59 } // namespace gl
60} // namespace yourgame
61
62#endif
Definition geometry.h:35
Definition shader.h:35
Definition texture.h:69
Definition camera.h:34
Definition trafo.h:33
std::array< float, 4 > drawSprite(yourgame::gl::Texture *texture, const yourgame::gl::TextureCoords &coords, float x, float y, float width, float height, float angle)
Definition drawing.cpp:93
void drawGeo(const yourgame::gl::Geometry *geo, const yourgame::gl::DrawConfig &cfg)
Definition drawing.cpp:28
void drawSky(yourgame::gl::Texture *texture, yourgame::math::Camera *camera, std::array< float, 3 > tint, yourgame::math::Trafo *trafo)
Definition drawing.cpp:168
Definition audio.h:27
Definition drawing.h:36
std::array< float, 4 > subtex
Definition drawing.h:41
yourgame::math::Camera * camera
Definition drawing.h:38
GLsizei instancecount
Definition drawing.h:42
std::vector< yourgame::gl::Texture * > textures
Definition drawing.h:40
glm::mat4 modelMat
Definition drawing.h:39
yourgame::gl::Shader * shader
Definition drawing.h:37
Definition texture.h:33