Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion es-core/src/components/VideoComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ VideoComponent::VideoComponent(Window* window) :
// Setup the default configuration
mConfig.showSnapshotDelay = false;
mConfig.showSnapshotNoVideo = false;
mConfig.startDelay = 0;
mConfig.startDelay = 0;
mConfig.magFilterLinear = false;
if (mWindow->getGuiStackSize() > 1) {
topWindow(false);
}
Expand Down Expand Up @@ -207,6 +208,9 @@ void VideoComponent::applyTheme(const std::shared_ptr<ThemeData>& theme, const s

if (elem->has("showSnapshotDelay"))
mConfig.showSnapshotDelay = elem->get<bool>("showSnapshotDelay");

if (elem->has("magFilterLinear"))
mConfig.magFilterLinear = elem->get<bool>("magFilterLinear");
}

std::vector<HelpPrompt> VideoComponent::getHelpPrompts()
Expand Down
1 change: 1 addition & 0 deletions es-core/src/components/VideoComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class VideoComponent : public GuiComponent
bool showSnapshotNoVideo;
bool showSnapshotDelay;
std::string defaultVideoPath;
bool magFilterLinear;
};

public:
Expand Down
3 changes: 2 additions & 1 deletion es-core/src/components/VideoVlcComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ void VideoVlcComponent::render(const Transform4x4f& parentTrans)
// Build a texture for the video frame
mTexture->initFromPixels((unsigned char*)mContext.surface->pixels, mContext.surface->w, mContext.surface->h);
mTexture->bind();

Renderer::setMagFilter(mConfig.magFilterLinear);

// Render it
Renderer::drawTriangleStrips(&vertices[0], 4);
}
Expand Down
1 change: 1 addition & 0 deletions es-core/src/renderers/Renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ namespace Renderer
void destroyTexture (const unsigned int _texture);
void updateTexture (const unsigned int _texture, const Texture::Type _type, const unsigned int _x, const unsigned _y, const unsigned int _width, const unsigned int _height, void* _data);
void bindTexture (const unsigned int _texture);
void setMagFilter (const bool _linearMag);
void drawLines (const Vertex* _vertices, const unsigned int _numVertices, const Blend::Factor _srcBlendFactor = Blend::SRC_ALPHA, const Blend::Factor _dstBlendFactor = Blend::ONE_MINUS_SRC_ALPHA);
void drawTriangleStrips(const Vertex* _vertices, const unsigned int _numVertices, const Blend::Factor _srcBlendFactor = Blend::SRC_ALPHA, const Blend::Factor _dstBlendFactor = Blend::ONE_MINUS_SRC_ALPHA);
void setProjection (const Transform4x4f& _projection);
Expand Down
5 changes: 5 additions & 0 deletions es-core/src/renderers/Renderer_GL14.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ namespace Renderer

} // bindTexture

void setMagFilter(const bool _linearMag)
{
GL_CHECK_ERROR(glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, _linearMag ? GL_LINEAR : GL_NEAREST));
} // change mag filter for currently bound texture

void drawLines(const Vertex* _vertices, const unsigned int _numVertices, const Blend::Factor _srcBlendFactor, const Blend::Factor _dstBlendFactor)
{
GL_CHECK_ERROR(glVertexPointer( 2, GL_FLOAT, sizeof(Vertex), &_vertices[0].pos));
Expand Down