thin3d: Add sampler state selection.

This commit is contained in:
Unknown W. Brackets committed 2016-02-13 14:03:43 -08:00
1 parent 0d68a172a9
commit 05fee24ccf
7 files changed
+192 -26

No files matched your search

+3
View File
@@ -23,6 +23,7 @@ UIContext::~UIContext() {
void UIContext::Init(Thin3DContext *thin3d, Thin3DShaderSet *uishader, Thin3DShaderSet *uishadernotex, Thin3DTexture *uitexture, DrawBuffer *uidrawbuffer, DrawBuffer *uidrawbufferTop) {
thin3d_ = thin3d;
blend_ = thin3d_->GetBlendStatePreset(T3DBlendStatePreset::BS_STANDARD_ALPHA);
sampler_ = thin3d_->GetSamplerStatePreset(T3DSamplerStatePreset::SAMPS_LINEAR);
depth_ = thin3d_->CreateDepthStencilState(false, false, T3DComparison::LESS);
uishader_ = uishader;
@@ -39,6 +40,7 @@ void UIContext::Init(Thin3DContext *thin3d, Thin3DShaderSet *uishader, Thin3DSha
void UIContext::Begin() {
thin3d_->SetBlendState(blend_);
thin3d_->SetSamplerStates(0, 1, &sampler_);
thin3d_->SetDepthStencilState(depth_);
thin3d_->SetRenderState(T3DRenderState::CULL_MODE, T3DCullMode::NO_CULL);
thin3d_->SetTexture(0, uitexture_);
@@ -48,6 +50,7 @@ void UIContext::Begin() {
void UIContext::BeginNoTex() {
thin3d_->SetBlendState(blend_);
thin3d_->SetSamplerStates(0, 1, &sampler_);
thin3d_->SetRenderState(T3DRenderState::CULL_MODE, T3DCullMode::NO_CULL);
UIBegin(uishadernotex_);
+2
View File
@@ -14,6 +14,7 @@ class Thin3DShaderSet;
class Thin3DDepthStencilState;
class Thin3DTexture;
class Thin3DBlendState;
class Thin3DSamplerState;
class Texture;
class DrawBuffer;
class TextDrawer;
@@ -82,6 +83,7 @@ private:
Thin3DContext *thin3D_;
Thin3DDepthStencilState *depth_;
Thin3DBlendState *blend_;
Thin3DSamplerState *sampler_;
Thin3DShaderSet *uishader_;
Thin3DShaderSet *uishadernotex_;
Thin3DTexture *uitexture_;