mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-13 11:05:46 -07:00
Rendering textures
This commit is contained in:
22
src/render/Texture.cpp
Normal file
22
src/render/Texture.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "Texture.hpp"
|
||||
|
||||
CTexture::CTexture() {
|
||||
// naffin'
|
||||
}
|
||||
|
||||
CTexture::CTexture(wlr_texture* tex) {
|
||||
RASSERT(wlr_texture_is_gles2(tex), "wlr_texture provided to CTexture that isn't GLES2!");
|
||||
wlr_gles2_texture_attribs attrs;
|
||||
wlr_gles2_texture_get_attribs(tex, &attrs);
|
||||
|
||||
m_iTarget = attrs.target;
|
||||
m_iTexID = attrs.tex;
|
||||
|
||||
if (m_iTarget == GL_TEXTURE_2D) {
|
||||
m_iType = attrs.has_alpha ? TEXTURE_RGBA : TEXTURE_RGBX;
|
||||
} else {
|
||||
m_iType = TEXTURE_EXTERNAL;
|
||||
}
|
||||
|
||||
m_vSize = Vector2D(tex->width, tex->height);
|
||||
}
|
Reference in New Issue
Block a user