mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-16 14:22:24 +08:00
Fixed issue with screens not at 0, 0 not rendering. Also cleaned up.
This commit is contained in:
parent
e56f128592
commit
a10a994da5
@ -89,8 +89,6 @@ void CContext::render ()
|
||||
if (this->m_viewports.empty () == false)
|
||||
{
|
||||
static Display* display = XOpenDisplay (nullptr);
|
||||
bool firstFrame = true;
|
||||
bool renderFrame = true;
|
||||
auto cur = this->m_viewports.begin ();
|
||||
auto end = this->m_viewports.end ();
|
||||
|
||||
@ -103,7 +101,7 @@ void CContext::render ()
|
||||
GC gc = XCreateGC(display, pm, 0, NULL);
|
||||
XFillRectangle(display, pm, gc, 0, 0, fullWidth, fullHeight);
|
||||
|
||||
char* image_data = this->m_wallpaper->renderImage (*cur, renderFrame, firstFrame);
|
||||
char* image_data = this->m_wallpaper->renderImage ();
|
||||
XImage* image = XCreateImage(display, CopyFromParent, 24, ZPixmap, 0, (char *)image_data, windowWidth, windowHeight, 32, 0);
|
||||
for (; cur != end; cur ++)
|
||||
{
|
||||
|
@ -287,13 +287,14 @@ void CWallpaper::render (glm::vec4 viewport, bool renderFrame, bool newFrame)
|
||||
glDrawArrays (GL_TRIANGLES, 0, 6);
|
||||
}
|
||||
|
||||
char* CWallpaper::renderImage (glm::vec4 viewport, bool renderFrame, bool newFrame)
|
||||
char* CWallpaper::renderImage ()
|
||||
{
|
||||
if (renderFrame == true)
|
||||
this->renderFrame (viewport);
|
||||
|
||||
int windowWidth = 1920;
|
||||
int windowHeight = 1080;
|
||||
glm::vec4 viewport = {0, 0, windowWidth, windowHeight};
|
||||
|
||||
this->renderFrame (viewport);
|
||||
|
||||
|
||||
if (this->getWallpaperData ()->is <WallpaperEngine::Core::CScene> ())
|
||||
{
|
||||
@ -380,7 +381,6 @@ char* CWallpaper::renderImage (glm::vec4 viewport, bool renderFrame, bool newFra
|
||||
|
||||
glBindFramebuffer (GL_FRAMEBUFFER, screen_fbo->getFramebuffer());
|
||||
|
||||
if (newFrame == true)
|
||||
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
glDisable (GL_BLEND);
|
||||
glDisable (GL_DEPTH_TEST);
|
||||
|
@ -36,7 +36,7 @@ namespace WallpaperEngine::Render
|
||||
/**
|
||||
* Performs a render pass of the wallpaper and returns the char* of the image
|
||||
*/
|
||||
char* renderImage (glm::vec4 viewport, bool renderFrame = true, bool newFrame = true);
|
||||
char* renderImage ();
|
||||
|
||||
/**
|
||||
* @return The container to resolve files for this wallpaper
|
||||
|
Loading…
Reference in New Issue
Block a user