mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-25 14:22:54 -06:00
GLDraw, GLCtrl: SMAA support in win32, various improvements, plugin/tess2
git-svn-id: svn://ultimatepp.org/upp/trunk@12348 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
19018b7e2a
commit
3ecc7906bb
30 changed files with 7120 additions and 43 deletions
|
|
@ -5,21 +5,11 @@
|
|||
#define LLOG(x) // DLOG(x)
|
||||
|
||||
namespace Upp {
|
||||
|
||||
struct ImageGLData {
|
||||
Image img;
|
||||
GLuint texture_id;
|
||||
|
||||
void Init(const Image& img, dword flags);
|
||||
~ImageGLData();
|
||||
};
|
||||
|
||||
void ImageGLData::Init(const Image& img_, dword flags)
|
||||
GLuint CreateGLTexture(const Image& img, dword flags)
|
||||
{
|
||||
LTIMING("CreateTexture");
|
||||
Image img = img_;
|
||||
Size sz = img.GetSize();
|
||||
|
||||
GLuint texture_id;
|
||||
glGenTextures(1, &texture_id);
|
||||
glBindTexture(GL_TEXTURE_2D, texture_id);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, sz.cx, sz.cy, 0, GL_BGRA, GL_UNSIGNED_BYTE, ~img);
|
||||
|
|
@ -34,6 +24,22 @@ void ImageGLData::Init(const Image& img_, dword flags)
|
|||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
return texture_id;
|
||||
}
|
||||
|
||||
struct ImageGLData {
|
||||
Image img;
|
||||
GLuint texture_id;
|
||||
|
||||
void Init(const Image& img, dword flags);
|
||||
~ImageGLData();
|
||||
};
|
||||
|
||||
void ImageGLData::Init(const Image& img, dword flags)
|
||||
{
|
||||
LTIMING("CreateTexture");
|
||||
|
||||
texture_id = CreateGLTexture(img, flags);
|
||||
|
||||
LLOG("Texture id created: " << texture_id);
|
||||
SysImageRealized(img);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue