prepare for 0.6.2
This commit is contained in:
parent
90859be901
commit
90c628612e
28 changed files with 4946 additions and 46 deletions
|
|
@ -35,7 +35,7 @@ bool FurnaceGUIRender::updateTexture(FurnaceGUITexture* which, void* data, int p
|
|||
return false;
|
||||
}
|
||||
|
||||
FurnaceGUITexture* FurnaceGUIRender::createTexture(bool dynamic, int width, int height) {
|
||||
FurnaceGUITexture* FurnaceGUIRender::createTexture(bool dynamic, int width, int height, bool interpolate) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ bool FurnaceGUIRenderDX11::updateTexture(FurnaceGUITexture* which, void* data, i
|
|||
return true;
|
||||
}
|
||||
|
||||
FurnaceGUITexture* FurnaceGUIRenderDX11::createTexture(bool dynamic, int width, int height) {
|
||||
FurnaceGUITexture* FurnaceGUIRenderDX11::createTexture(bool dynamic, int width, int height, bool interpolate) {
|
||||
D3D11_TEXTURE2D_DESC texDesc;
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC viewDesc;
|
||||
ID3D11Texture2D* tex=NULL;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class FurnaceGUIRenderDX11: public FurnaceGUIRender {
|
|||
bool lockTexture(FurnaceGUITexture* which, void** data, int* pitch);
|
||||
bool unlockTexture(FurnaceGUITexture* which);
|
||||
bool updateTexture(FurnaceGUITexture* which, void* data, int pitch);
|
||||
FurnaceGUITexture* createTexture(bool dynamic, int width, int height);
|
||||
FurnaceGUITexture* createTexture(bool dynamic, int width, int height, bool interpolate=true);
|
||||
bool destroyTexture(FurnaceGUITexture* which);
|
||||
void setTextureBlendMode(FurnaceGUITexture* which, FurnaceGUIBlendMode mode);
|
||||
void setBlendMode(FurnaceGUIBlendMode mode);
|
||||
|
|
|
|||
|
|
@ -301,12 +301,17 @@ bool FurnaceGUIRenderGL::updateTexture(FurnaceGUITexture* which, void* data, int
|
|||
return true;
|
||||
}
|
||||
|
||||
FurnaceGUITexture* FurnaceGUIRenderGL::createTexture(bool dynamic, int width, int height) {
|
||||
FurnaceGUITexture* FurnaceGUIRenderGL::createTexture(bool dynamic, int width, int height, bool interpolate) {
|
||||
FurnaceGLTexture* t=new FurnaceGLTexture;
|
||||
C(glGenTextures(1,&t->id));
|
||||
C(glBindTexture(GL_TEXTURE_2D,t->id));
|
||||
C(glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR));
|
||||
C(glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR));
|
||||
if (interpolate) {
|
||||
C(glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR));
|
||||
C(glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR));
|
||||
} else {
|
||||
C(glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST));
|
||||
C(glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST));
|
||||
}
|
||||
C(glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,width,height,0,GL_RGBA,PIXEL_FORMAT,NULL));
|
||||
C(furActiveTexture(GL_TEXTURE0));
|
||||
t->width=width;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class FurnaceGUIRenderGL: public FurnaceGUIRender {
|
|||
bool lockTexture(FurnaceGUITexture* which, void** data, int* pitch);
|
||||
bool unlockTexture(FurnaceGUITexture* which);
|
||||
bool updateTexture(FurnaceGUITexture* which, void* data, int pitch);
|
||||
FurnaceGUITexture* createTexture(bool dynamic, int width, int height);
|
||||
FurnaceGUITexture* createTexture(bool dynamic, int width, int height, bool interpolate=true);
|
||||
bool destroyTexture(FurnaceGUITexture* which);
|
||||
void setTextureBlendMode(FurnaceGUITexture* which, FurnaceGUIBlendMode mode);
|
||||
void setBlendMode(FurnaceGUIBlendMode mode);
|
||||
|
|
|
|||
|
|
@ -49,8 +49,10 @@ bool FurnaceGUIRenderSDL::updateTexture(FurnaceGUITexture* which, void* data, in
|
|||
return SDL_UpdateTexture(t->tex,NULL,data,pitch)==0;
|
||||
}
|
||||
|
||||
FurnaceGUITexture* FurnaceGUIRenderSDL::createTexture(bool dynamic, int width, int height) {
|
||||
FurnaceGUITexture* FurnaceGUIRenderSDL::createTexture(bool dynamic, int width, int height, bool interpolate) {
|
||||
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY,interpolate?"1":"0");
|
||||
SDL_Texture* t=SDL_CreateTexture(sdlRend,SDL_PIXELFORMAT_ABGR8888,dynamic?SDL_TEXTUREACCESS_STREAMING:SDL_TEXTUREACCESS_STATIC,width,height);
|
||||
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY,"1");
|
||||
|
||||
if (t==NULL) return NULL;
|
||||
FurnaceSDLTexture* ret=new FurnaceSDLTexture;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class FurnaceGUIRenderSDL: public FurnaceGUIRender {
|
|||
bool lockTexture(FurnaceGUITexture* which, void** data, int* pitch);
|
||||
bool unlockTexture(FurnaceGUITexture* which);
|
||||
bool updateTexture(FurnaceGUITexture* which, void* data, int pitch);
|
||||
FurnaceGUITexture* createTexture(bool dynamic, int width, int height);
|
||||
FurnaceGUITexture* createTexture(bool dynamic, int width, int height, bool interpolate=true);
|
||||
bool destroyTexture(FurnaceGUITexture* which);
|
||||
void setTextureBlendMode(FurnaceGUITexture* which, FurnaceGUIBlendMode mode);
|
||||
void setBlendMode(FurnaceGUIBlendMode mode);
|
||||
|
|
@ -46,4 +46,4 @@ class FurnaceGUIRenderSDL: public FurnaceGUIRender {
|
|||
bool quit();
|
||||
FurnaceGUIRenderSDL():
|
||||
sdlRend(NULL) {}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue