DirectX 9 backend, part 8
This commit is contained in:
parent
cbf9e96067
commit
d86d248ef3
|
@ -46,6 +46,16 @@ ImTextureID FurnaceGUIRenderDX9::getTextureID(FurnaceGUITexture* which) {
|
||||||
return (ImTextureID)t->tex;
|
return (ImTextureID)t->tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float FurnaceGUIRenderDX9::getTextureU(FurnaceGUITexture* which) {
|
||||||
|
FurnaceDX9Texture* t=(FurnaceDX9Texture*)which;
|
||||||
|
return (float)t->width/(float)t->widthReal;
|
||||||
|
}
|
||||||
|
|
||||||
|
float FurnaceGUIRenderDX9::getTextureV(FurnaceGUITexture* which) {
|
||||||
|
FurnaceDX9Texture* t=(FurnaceDX9Texture*)which;
|
||||||
|
return (float)t->height/(float)t->heightReal;
|
||||||
|
}
|
||||||
|
|
||||||
bool FurnaceGUIRenderDX9::lockTexture(FurnaceGUITexture* which, void** data, int* pitch) {
|
bool FurnaceGUIRenderDX9::lockTexture(FurnaceGUITexture* which, void** data, int* pitch) {
|
||||||
FurnaceDX9Texture* t=(FurnaceDX9Texture*)which;
|
FurnaceDX9Texture* t=(FurnaceDX9Texture*)which;
|
||||||
D3DLOCKED_RECT lockedRect;
|
D3DLOCKED_RECT lockedRect;
|
||||||
|
@ -76,6 +86,7 @@ bool FurnaceGUIRenderDX9::unlockTexture(FurnaceGUITexture* which) {
|
||||||
|
|
||||||
bool FurnaceGUIRenderDX9::updateTexture(FurnaceGUITexture* which, void* data, int pitch) {
|
bool FurnaceGUIRenderDX9::updateTexture(FurnaceGUITexture* which, void* data, int pitch) {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +106,7 @@ FurnaceGUITexture* FurnaceGUIRenderDX9::createTexture(bool dynamic, int width, i
|
||||||
|
|
||||||
if (!supportsDynamicTex) dynamic=false;
|
if (!supportsDynamicTex) dynamic=false;
|
||||||
|
|
||||||
HRESULT result=device->CreateTexture(widthReal,heightReal,1,dynamic?D3DUSAGE_DYNAMIC:0,D3DFMT_A8R8G8B8,D3DPOOL_DEFAULT,&tex,NULL);
|
HRESULT result=device->CreateTexture(widthReal,heightReal,1,dynamic?D3DUSAGE_DYNAMIC:0,D3DFMT_A8B8G8R8,D3DPOOL_DEFAULT,&tex,NULL);
|
||||||
|
|
||||||
if (result!=D3D_OK) {
|
if (result!=D3D_OK) {
|
||||||
logW("could not create texture! %.8x",result);
|
logW("could not create texture! %.8x",result);
|
||||||
|
|
|
@ -45,6 +45,8 @@ class FurnaceGUIRenderDX9: public FurnaceGUIRender {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ImTextureID getTextureID(FurnaceGUITexture* which);
|
ImTextureID getTextureID(FurnaceGUITexture* which);
|
||||||
|
float getTextureU(FurnaceGUITexture* which);
|
||||||
|
float getTextureV(FurnaceGUITexture* which);
|
||||||
bool lockTexture(FurnaceGUITexture* which, void** data, int* pitch);
|
bool lockTexture(FurnaceGUITexture* which, void** data, int* pitch);
|
||||||
bool unlockTexture(FurnaceGUITexture* which);
|
bool unlockTexture(FurnaceGUITexture* which);
|
||||||
bool updateTexture(FurnaceGUITexture* which, void* data, int pitch);
|
bool updateTexture(FurnaceGUITexture* which, void* data, int pitch);
|
||||||
|
|
Loading…
Reference in a new issue