mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-20 19:02:43 +00:00
- minor cleanup of FHardwareTexture.
Inlining of a trivial function and removing dependency on the render state, unbinding the render state should be done elsewhere.
This commit is contained in:
parent
a517b04908
commit
5861fdd4bd
3 changed files with 19 additions and 15 deletions
|
@ -263,6 +263,7 @@ void OpenGLFrameBuffer::Swap()
|
|||
Finish.Unclock();
|
||||
camtexcount = 0;
|
||||
FHardwareTexture::UnbindAll();
|
||||
gl_RenderState.ClearLastMaterial();
|
||||
mDebug->Update();
|
||||
}
|
||||
|
||||
|
@ -321,6 +322,7 @@ void OpenGLFrameBuffer::PrecacheMaterial(FMaterial *mat, int translation)
|
|||
}
|
||||
// unbind everything.
|
||||
FHardwareTexture::UnbindAll();
|
||||
gl_RenderState.ClearLastMaterial();
|
||||
}
|
||||
|
||||
IVertexBuffer *OpenGLFrameBuffer::CreateVertexBuffer()
|
||||
|
|
|
@ -42,14 +42,14 @@
|
|||
#include "hw_cvars.h"
|
||||
#include "gl_debug.h"
|
||||
#include "gl_renderer.h"
|
||||
#include "gl_renderstate.h"
|
||||
#include "gl_samplers.h"
|
||||
#include "gl_hwtexture.h"
|
||||
|
||||
namespace OpenGLRenderer
|
||||
{
|
||||
|
||||
|
||||
TexFilter_s TexFilter[]={
|
||||
TexFilter_s TexFilter[] = {
|
||||
{GL_NEAREST, GL_NEAREST, false},
|
||||
{GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST, true},
|
||||
{GL_LINEAR, GL_LINEAR, false},
|
||||
|
@ -237,11 +237,6 @@ unsigned int FHardwareTexture::Bind(int texunit, bool needmipmap)
|
|||
return 0;
|
||||
}
|
||||
|
||||
unsigned int FHardwareTexture::GetTextureHandle(int translation)
|
||||
{
|
||||
return glTexID;
|
||||
}
|
||||
|
||||
void FHardwareTexture::Unbind(int texunit)
|
||||
{
|
||||
if (lastbound[texunit] != 0)
|
||||
|
@ -259,7 +254,6 @@ void FHardwareTexture::UnbindAll()
|
|||
{
|
||||
Unbind(texunit);
|
||||
}
|
||||
gl_RenderState.ClearLastMaterial();
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#pragma once
|
||||
class FBitmap;
|
||||
class FTexture;
|
||||
|
||||
#include "tarray.h"
|
||||
#include "hw_ihwtexture.h"
|
||||
|
||||
#ifndef __GLTEXTURE_H
|
||||
#define __GLTEXTURE_H
|
||||
|
||||
#ifdef LoadImage
|
||||
#undef LoadImage
|
||||
|
@ -59,14 +63,18 @@ public:
|
|||
void BindToFrameBuffer(int w, int h);
|
||||
|
||||
unsigned int Bind(int texunit, bool needmipmap);
|
||||
bool BindOrCreate(FTexture *tex, int texunit, int clampmode, int translation, int flags);
|
||||
bool BindOrCreate(FTexture* tex, int texunit, int clampmode, int translation, int flags);
|
||||
|
||||
void AllocateBuffer(int w, int h, int texelsize);
|
||||
uint8_t *MapBuffer();
|
||||
uint8_t* MapBuffer();
|
||||
|
||||
unsigned int CreateTexture(unsigned char * buffer, int w, int h, int texunit, bool mipmap, const char *name);
|
||||
unsigned int GetTextureHandle(int translation);
|
||||
unsigned int CreateTexture(unsigned char* buffer, int w, int h, int texunit, bool mipmap, const char* name);
|
||||
unsigned int GetTextureHandle()
|
||||
{
|
||||
return glTexID;
|
||||
}
|
||||
|
||||
int numChannels() { return glTextureBytes; }
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue