openMSX
video
GLImage.hh
Go to the documentation of this file.
1
#ifndef GLTEXTURE_HH
2
#define GLTEXTURE_HH
3
4
#include "
BaseImage.hh
"
5
#include "
GLUtil.hh
"
6
#include <array>
7
#include <cstdint>
8
#include <span>
9
#include <string>
10
11
class
SDLSurfacePtr
;
12
13
namespace
openmsx
{
14
15
class
GLImage
final :
public
BaseImage
16
{
17
public
:
18
GLImage
(
OutputSurface
& output,
const
std::string& filename);
19
GLImage
(
OutputSurface
& output,
SDLSurfacePtr
image
);
20
GLImage
(
OutputSurface
& output,
const
std::string& filename,
float
scaleFactor);
21
GLImage
(
OutputSurface
& output,
const
std::string& filename,
gl::ivec2
size
);
22
GLImage
(
OutputSurface
& output,
gl::ivec2
size
, uint32_t rgba);
23
GLImage
(
OutputSurface
& output,
gl::ivec2
size
, std::span<const uint32_t, 4> rgba,
24
int
borderSize, uint32_t borderRGBA);
25
26
void
draw
(
OutputSurface
& output,
gl::ivec2
pos,
27
uint8_t r, uint8_t
g
, uint8_t b, uint8_t alpha)
override
;
28
29
private
:
30
void
initBuffers();
31
32
private
:
33
std::array<gl::BufferObject, 3> vbo;
34
gl::BufferObject
elementsBuffer;
35
gl::Texture
texture{
gl::Null
()};
// must come after size
36
int
borderSize{0};
37
std::array<uint16_t, 4> bgA;
// 0..256
38
uint16_t borderA{0};
// 0..256
39
std::array<uint8_t, 4> bgR, bgG, bgB;
40
uint8_t borderR{0}, borderG{0}, borderB{0};
41
};
42
43
}
// namespace openmsx
44
45
#endif
BaseImage.hh
GLUtil.hh
image
std::string image
Definition:
HDImageCLI.cc:13
g
int g
Definition:
ScopedAssign_test.cc:20
SDLSurfacePtr
Wrapper around a SDL_Surface.
Definition:
SDLSurfacePtr.hh:35
gl::BufferObject
Definition:
GLUtil.hh:449
gl::Texture
Most basic/generic texture: only contains a texture ID.
Definition:
GLUtil.hh:40
gl::vecN
Definition:
gl_vec.hh:33
openmsx::BaseImage
Definition:
BaseImage.hh:12
openmsx::BaseImage::size
gl::ivec2 size
Definition:
BaseImage.hh:31
openmsx::GLImage
Definition:
GLImage.hh:16
openmsx::GLImage::draw
void draw(OutputSurface &output, gl::ivec2 pos, uint8_t r, uint8_t g, uint8_t b, uint8_t alpha) override
Definition:
GLImage.cc:127
openmsx::GLImage::GLImage
GLImage(OutputSurface &output, const std::string &filename)
Definition:
GLImage.cc:57
openmsx::OutputSurface
A frame buffer where pixels can be written to.
Definition:
OutputSurface.hh:21
openmsx
This file implemented 3 utility functions:
Definition:
Autofire.cc:9
gl::Null
Definition:
GLUtil.hh:33
Generated on Wed Sep 27 2023 14:13:12 for openMSX by
1.9.4