author | František Kučera <franta-hg@frantovo.cz> |
Thu, 28 Dec 2023 01:35:17 +0100 | |
branch | v_0 |
changeset 37 | fb673fa1cad5 |
parent 31 | ed3caeea978a |
permissions | -rw-r--r-- |
19 | 1 |
/** |
29
dc3c102e1264
derive OHP3D from ShaderShark
František Kučera <franta-hg@frantovo.cz>
parents:
28
diff
changeset
|
2 |
* OHP3D |
19 | 3 |
* Copyright © 2023 František Kučera (Frantovo.cz, GlobalCode.info) |
4 |
* |
|
5 |
* This program is free software: you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation, version 3 of the License. |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 |
*/ |
|
17 |
||
18 |
#pragma once |
|
19 |
||
20 |
#include <string> |
|
21 |
||
22 |
#include "Buffer.h" |
|
23 |
||
24 |
class Texture { |
|
25 |
public: |
|
26 |
||
27 |
/** |
|
28 |
* @param width horizontal pixel count |
|
29 |
* @param height vertical pixel count |
|
30 |
* @param img RGBA pixels, 8 bits per channel, size == width * height * 4 |
|
31 |
* @param fileName not used by this class, just stored for others |
|
32 |
*/ |
|
33 |
Texture(int width, int height, const Buffer& img, |
|
34 |
const std::string& fileName); |
|
35 |
virtual ~Texture(); |
|
36 |
GLuint getId() const; |
|
37 |
const std::string getFileName() const; |
|
38 |
int getWidth() const; |
|
39 |
int getHeight() const; |
|
40 |
GLfloat getRatio() const; |
|
28
4cbd9c0beb4c
pass texture xattr 'shader-shark.texture.scale' to the shaders as 'uTextureScale' + update variable locations on each shader reload
František Kučera <franta-hg@frantovo.cz>
parents:
19
diff
changeset
|
41 |
GLfloat getScale() const; |
4cbd9c0beb4c
pass texture xattr 'shader-shark.texture.scale' to the shaders as 'uTextureScale' + update variable locations on each shader reload
František Kučera <franta-hg@frantovo.cz>
parents:
19
diff
changeset
|
42 |
void setScale(GLfloat scale); |
19 | 43 |
void update(int width, int height, const Buffer& img); |
31
ed3caeea978a
render all PDF pages
František Kučera <franta-hg@frantovo.cz>
parents:
29
diff
changeset
|
44 |
void bind(); |
19 | 45 |
private: |
46 |
class Impl; |
|
47 |
Impl* impl; |
|
48 |
Texture(const Texture&) = delete; |
|
49 |
Texture& operator=(const Texture&) = delete; |
|
50 |
}; |