~ changed glfw to use a custom library version until upstream adds proper support for this

~ brought back proper background rendering and position detection

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
Alexis Maiquez 2021-09-08 19:09:43 +02:00
parent 0dc5228cf0
commit 0225cac917
17 changed files with 210 additions and 363 deletions

1
.gitignore vendored
View File

@ -2,4 +2,3 @@ cmake-build-debug
assets.zip
.idea
assets/
lib/

View File

@ -9,10 +9,12 @@ set(OpenGL_GL_PREFERENCE "LEGACY")
# if you're developing you might find this debug option useful for shader output, although RenderDoc is encouraged
add_compile_definitions(DEBUG=0)
# add glfw3 customized version to the compilation
add_subdirectory (lib/glfw)
find_package(X11 REQUIRED)
find_package(Xrandr REQUIRED)
find_package(OpenGL REQUIRED)
find_package(GLFW3 3.1 REQUIRED)
find_package(GLEW REQUIRED)
find_package(GLUT REQUIRED)
find_package(ZLIB REQUIRED)
@ -26,7 +28,6 @@ include_directories(
${X11_INCLUDE_DIR}
${XRANDR_INCLUDE_DIR}
${GLEW_INCLUDE_DIR}
${glfw3_INCLUDE_DIR}
${LZ4_INCLUDE_DIR}
${SDL_INCLUDE_DIRS}
${SDL_MIXER_INCLUDE_DIRS}
@ -69,6 +70,9 @@ add_executable(
src/WallpaperEngine/Render/Shaders/Compiler.h
src/WallpaperEngine/Render/Shaders/Compiler.cpp
src/WallpaperEngine/Render/CContext.h
src/WallpaperEngine/Render/CContext.cpp
src/WallpaperEngine/Render/CWallpaper.h
src/WallpaperEngine/Render/CWallpaper.cpp
src/WallpaperEngine/Render/CScene.h
@ -183,11 +187,11 @@ target_link_libraries(wallengine
${X11_Xxf86vm_LIB}
${OPENGL_LIBRARIES}
${GLEW_LIBRARIES}
${GLFW3_LIBRARY}
${GLUT_LIBRARIES}
${ZLIB_LIBRARIES}
${LZ4_LIBRARY}
${SDL_LIBRARY}
${SDL_MIXER_LIBRARIES}
${FFMPEG_LIBRARIES}
${FREEIMAGE_LIBRARIES})
${FREEIMAGE_LIBRARIES}
glfw)

View File

@ -1,47 +0,0 @@
# Locate the glfw3 library
#
# This module defines the following variables:
#
# GLFW3_LIBRARY the name of the library;
# GLFW3_INCLUDE_DIR where to find glfw include files.
# GLFW3_FOUND true if both the GLFW3_LIBRARY and GLFW3_INCLUDE_DIR have been found.
#
# To help locate the library and include file, you can define a
# variable called GLFW3_ROOT which points to the root of the glfw library
# installation.
#
# default search dirs
#
# Cmake file from: https://github.com/daw42/glslcookbook
set( _glfw3_HEADER_SEARCH_DIRS
"/usr/include"
"/usr/local/include"
"${CMAKE_SOURCE_DIR}/includes" )
set( _glfw3_LIB_SEARCH_DIRS
"/usr/lib"
"/usr/local/lib"
"${CMAKE_SOURCE_DIR}/lib")
# Check environment for root search directory
set( _glfw3_ENV_ROOT $ENV{GLFW3_ROOT} )
if( NOT GLFW3_ROOT AND _glfw3_ENV_ROOT )
set(GLFW3_ROOT ${_glfw3_ENV_ROOT} )
endif()
# Put user specified location at beginning of search
if( GLFW3_ROOT )
list( INSERT _glfw3_HEADER_SEARCH_DIRS 0 "${GLFW3_ROOT}/include" )
list( INSERT _glfw3_LIB_SEARCH_DIRS 0 "${GLFW3_ROOT}/lib" )
endif()
# Search for the header
FIND_PATH(GLFW3_INCLUDE_DIR "GLFW/glfw3.h"
PATHS ${_glfw3_HEADER_SEARCH_DIRS} )
# Search for the library
FIND_LIBRARY(GLFW3_LIBRARY NAMES glfw3 glfw
PATHS ${_glfw3_LIB_SEARCH_DIRS} )
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLFW3 DEFAULT_MSG
GLFW3_LIBRARY GLFW3_INCLUDE_DIR)

View File

@ -17,7 +17,7 @@ Wallpaper Engine is a software designed by [Kristjan Skutta](https://store.steam
- FFmpeg
- X11
- Xrandr
- GLW3
- GLFW3
- GLM
- FreeImage
@ -69,7 +69,7 @@ Uncompressed backgrounds are just plain folders including all the resources and
./wallengine --dir folder
```
#### 5.4.3. Running as a screen's background (NOT SUPPORTED IN THIS BUILD YET)
#### 5.4.3. Running as a screen's background
Only screens configured with the XRandr extension are supported. To specify the screen names (as reported from xrandr tool) just use the ```--screen-root``` switch. You can specify multiple screens at the same time, for example:
```
./wallengine --screen-root HDMI-1 --screen-root DVI-D-1

1
lib/glfw Submodule

@ -0,0 +1 @@
Subproject commit f4d5f760fdd69731c39d20c41a80945d61299778

View File

@ -5,17 +5,16 @@
#include <SDL.h>
#include <FreeImage.h>
#define GLFW_EXPOSE_NATIVE_X11
#include <GL/glew.h>
#include <GLFW/glfw3.h>
// #include <GLFW/glfw3native.h>
#include <GL/glx.h>
#include "GLFW/glfw3.h"
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include "WallpaperEngine/Core/CProject.h"
#include "WallpaperEngine/Render/CWallpaper.h"
#include "WallpaperEngine/Render/CContext.h"
#include "WallpaperEngine/Render/CScene.h"
#include "WallpaperEngine/Render/CVideo.h"
@ -179,6 +178,9 @@ int main (int argc, char* argv[])
auto project = WallpaperEngine::Core::CProject::fromFile ("project.json", containers);
WallpaperEngine::Render::CWallpaper* wallpaper;
// initialize custom context class
WallpaperEngine::Render::CContext* context = new WallpaperEngine::Render::CContext (screens);
// auto projection = project->getWallpaper ()->as <WallpaperEngine::Core::CScene> ()->getOrthogonalProjection ();
// create the window!
// TODO: DO WE NEED TO PASS MONITOR HERE OR ANYTHING?
@ -227,6 +229,9 @@ int main (int argc, char* argv[])
throw std::runtime_error ("Unsupported wallpaper type");
}
// ensure the context knows what wallpaper to render
context->setWallpaper (wallpaper);
if (shouldEnableAudio == true)
{
int mixer_flags = MIX_INIT_MP3 | MIX_INIT_FLAC | MIX_INIT_OGG;
@ -264,7 +269,7 @@ int main (int argc, char* argv[])
// get the start time of the frame
startTime = clock ();
// render the scene
wallpaper->render ();
context->render ();
// do buffer swapping
glfwSwapBuffers (window);
// poll for events (like closing the window)

View File

@ -73,7 +73,7 @@ namespace WallpaperEngine::Assets
*/
enum TextureFlags : uint32_t
{
None = 0,
NoFlags = 0,
NoInterpolation = 1,
ClampUVs = 2,
IsGif = 4,

View File

@ -1,236 +0,0 @@
#include <iostream>
#include <stdexcept>
#include <utility>
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
#include "WallpaperEngine/Render/Shaders/Variables/CShaderVariableFloatPointer.h"
#include "WallpaperEngine/Render/Shaders/Variables/CShaderVariableVector2Pointer.h"
#include "CContext.h"
using namespace WallpaperEngine;
using namespace WallpaperEngine::Irrlicht;
CContext::CContext (std::vector<std::string> screens, bool isRootWindow) :
m_screens (std::move(screens)),
m_isRootWindow (isRootWindow)
{
}
void CContext::setDevice (irr::IrrlichtDevice* device)
{
this->m_device = device;
}
void CContext::initializeContext ()
{
irr::SIrrlichtCreationParameters irrlichtCreationParameters;
// initialize event receiver first
this->m_eventReceiver = new CEventReceiver ();
// prepare basic configuration for irrlicht
irrlichtCreationParameters.AntiAlias = 8;
irrlichtCreationParameters.Bits = 16;
// _irr_params.DeviceType = Irrlicht::EIDT_X11;
irrlichtCreationParameters.DriverType = irr::video::EDT_OPENGL;
irrlichtCreationParameters.Doublebuffer = false;
irrlichtCreationParameters.EventReceiver = this->m_eventReceiver;
irrlichtCreationParameters.Fullscreen = false;
irrlichtCreationParameters.HandleSRGB = false;
irrlichtCreationParameters.IgnoreInput = false;
irrlichtCreationParameters.Stencilbuffer = true;
irrlichtCreationParameters.UsePerformanceTimer = false;
irrlichtCreationParameters.Vsync = false;
irrlichtCreationParameters.WithAlphaChannel = false;
irrlichtCreationParameters.ZBufferBits = 24;
irrlichtCreationParameters.LoggingLevel = irr::ELL_DEBUG;
this->initializeViewports (irrlichtCreationParameters);
this->setDevice (irr::createDeviceEx (irrlichtCreationParameters));
if (this->getDevice () == nullptr)
{
throw std::runtime_error ("Cannot create irrlicht device");
}
this->getDevice ()->setWindowCaption (L"Test game");
// check for ps and vs support
if (
this->getDevice ()->getVideoDriver()->queryFeature (irr::video::EVDF_PIXEL_SHADER_2_0) == false &&
this->getDevice ()->getVideoDriver()->queryFeature (irr::video::EVDF_ARB_FRAGMENT_PROGRAM_1) == false)
{
throw std::runtime_error ("Pixel Shader 2.0 not supported by your video driver/hardware");
}
if (
this->getDevice ()->getVideoDriver()->queryFeature (irr::video::EVDF_VERTEX_SHADER_2_0) == false &&
this->getDevice ()->getVideoDriver()->queryFeature (irr::video::EVDF_ARB_VERTEX_PROGRAM_1) == false)
{
throw std::runtime_error ("Vertex Shader 2.0 not supported by your video driver/hardware");
}
if (this->getDevice ()->getVideoDriver ()->queryFeature (irr::video::EVDF_RENDER_TO_TARGET) == false)
{
throw std::runtime_error ("Render to texture not supported by your video driver/hardware");
}
// load the assets from wallpaper engine
this->getDevice ()->getFileSystem ()->addFileArchive ("assets.zip", true, false);
// register custom loaders
this->getDevice ()->getVideoDriver()->addExternalImageLoader (
new WallpaperEngine::Irrlicht::CImageLoaderTex (this)
);
this->getDevice ()->getFileSystem ()->addArchiveLoader (
new WallpaperEngine::Irrlicht::CArchiveLoaderPkg (this)
);
// register time shader variable
this->insertShaderVariable (
new Render::Shaders::Variables::CShaderVariableFloatPointer (&this->m_time, "g_Time")
);
// register normalized uv position for mouse
this->insertShaderVariable (
new Render::Shaders::Variables::CShaderVariableVector2Pointer (&this->m_pointerPosition, "g_PointerPosition")
);
}
void CContext::initializeViewports (irr::SIrrlichtCreationParameters &irrlichtCreationParameters)
{
if (this->m_isRootWindow == false || this->m_screens.empty () == true)
return;
Display* display = XOpenDisplay (nullptr);
int xrandr_result, xrandr_error;
if (!XRRQueryExtension (display, &xrandr_result, &xrandr_error))
{
std::cerr << "XRandr is not present, cannot detect specified screens, running in window mode" << std::endl;
return;
}
XRRScreenResources* screenResources = XRRGetScreenResources (display, DefaultRootWindow (display));
// there are some situations where xrandr returns null (like screen not using the extension)
if (screenResources == nullptr)
return;
for (int i = 0; i < screenResources->noutput; i ++)
{
XRROutputInfo* info = XRRGetOutputInfo (display, screenResources, screenResources->outputs [i]);
// there are some situations where xrandr returns null (like screen not using the extension)
if (info == nullptr)
continue;
auto cur = this->m_screens.begin ();
auto end = this->m_screens.end ();
for (; cur != end; cur ++)
{
if (info->connection == RR_Connected && strcmp (info->name, (*cur).c_str ()) == 0)
{
XRRCrtcInfo* crtc = XRRGetCrtcInfo (display, screenResources, info->crtc);
std::cout << "Found requested screen: " << info->name << " -> " << crtc->x << "x" << crtc->y << ":" << crtc->width << "x" << crtc->height << std::endl;
irr::core::rect<irr::s32> viewport;
viewport.UpperLeftCorner.X = crtc->x;
viewport.UpperLeftCorner.Y = crtc->y;
viewport.LowerRightCorner.X = crtc->x + crtc->width;
viewport.LowerRightCorner.Y = crtc->y + crtc->height;
this->m_viewports.push_back (viewport);
XRRFreeCrtcInfo (crtc);
}
}
XRRFreeOutputInfo (info);
}
XRRFreeScreenResources (screenResources);
irrlichtCreationParameters.WindowId = reinterpret_cast<void*> (DefaultRootWindow (display));
}
void CContext::renderFrame (Render::CWallpaper* wallpaper)
{
this->m_time = this->getDevice ()->getTimer ()->getTime () / 1000.0f;
this->m_pointerPosition.X = this->m_eventReceiver->getPosition ().X / (float) this->getDevice ()->getVideoDriver ()->getScreenSize ().Width;
this->m_pointerPosition.Y = this->m_eventReceiver->getPosition ().Y / (float) this->getDevice ()->getVideoDriver ()->getScreenSize ().Height;
if (this->m_viewports.empty () == true)
{
this->drawWallpaper (wallpaper, true);
}
else
{
auto cur = this->m_viewports.begin ();
auto end = this->m_viewports.end ();
for (; cur != end; cur ++)
{
// change viewport to render to the correct portion of the display
this->getDevice ()->getVideoDriver ()->setViewPort (*cur);
this->drawWallpaper (wallpaper, false);
}
}
}
void CContext::drawWallpaper (Render::CWallpaper* wallpaper, bool backBuffer)
{
// TODO: Get scene clear color
this->getDevice ()->getVideoDriver ()->beginScene (backBuffer, true);
this->getDevice ()->getSceneManager ()->drawAll ();
this->getDevice ()->getVideoDriver ()->endScene ();
}
void CContext::insertShaderVariable (Render::Shaders::Variables::CShaderVariable* variable)
{
this->m_globalShaderVariables.push_back (variable);
}
const std::vector<Render::Shaders::Variables::CShaderVariable*>& CContext::getShaderVariables () const
{
return this->m_globalShaderVariables;
}
irr::IrrlichtDevice* CContext::getDevice ()
{
return this->m_device;
}
irr::io::path CContext::resolveFile (const irr::io::path& file)
{
if (this->getDevice ()->getFileSystem ()->existFile (file) == false)
{
throw std::runtime_error ("Cannot find file " + std::string (file.c_str ()));
}
return file;
}
irr::io::path CContext::resolveMaterials (const std::string& materialName)
{
return this->resolveFile (std::string ("materials/" + materialName + ".tex").c_str ());
}
irr::io::path CContext::resolveVertexShader (const std::string& vertexShader)
{
return this->resolveFile (std::string ("shaders/" + vertexShader + ".vert").c_str ());
}
irr::io::path CContext::resolveFragmentShader (const std::string& fragmentShader)
{
return this->resolveFile (std::string ("shaders/" + fragmentShader + ".frag").c_str ());
}
irr::io::path CContext::resolveIncludeShader (const std::string& includeShader)
{
return this->resolveFile (std::string ("shaders/" + includeShader).c_str ());
}

View File

@ -1,57 +0,0 @@
#pragma once
#include <vector>
#include <string>
#include <irrlicht/irrlicht.h>
#include "WallpaperEngine/Render/CWallpaper.h"
#include "WallpaperEngine/Render/Shaders/Variables/CShaderVariable.h"
#include "CEventReceiver.h"
namespace WallpaperEngine::Render
{
class CWallpaper;
};
namespace WallpaperEngine::Irrlicht
{
class CContext
{
public:
CContext (std::vector<std::string> screens, bool isRootWindow = false);
void setDevice (irr::IrrlichtDevice* device);
void initializeContext ();
void insertShaderVariable (Render::Shaders::Variables::CShaderVariable* variable);
const std::vector<Render::Shaders::Variables::CShaderVariable*>& getShaderVariables () const;
void renderFrame (Render::CWallpaper* wallpaper);
irr::IrrlichtDevice* getDevice ();
irr::io::path resolveMaterials (const std::string& materialName);
irr::io::path resolveVertexShader (const std::string& vertexShader);
irr::io::path resolveFragmentShader (const std::string& fragmentShader);
irr::io::path resolveIncludeShader (const std::string& includeShader);
private:
void initializeViewports (irr::SIrrlichtCreationParameters& irrlichtCreationParameters);
void drawWallpaper (Render::CWallpaper* wallpaper, bool backBuffer);
irr::io::path resolveFile (const irr::io::path& file);
irr::IrrlichtDevice* m_device;
CEventReceiver* m_eventReceiver;
std::vector<Render::Shaders::Variables::CShaderVariable*> m_globalShaderVariables;
float m_time;
irr::core::vector2df m_pointerPosition;
std::vector<std::string> m_screens;
std::vector<irr::core::recti> m_viewports;
bool m_isRootWindow;
};
};

View File

@ -0,0 +1,108 @@
#include <iostream>
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
#include <GL/glew.h>
#include <GL/glx.h>
#include "CContext.h"
using namespace WallpaperEngine::Render;
CContext::CContext (std::vector <std::string> screens) :
m_wallpaper (nullptr),
m_screens (std::move (screens)),
m_isRootWindow (m_screens.empty () == false),
m_window (0)
{
this->initializeViewports ();
}
void CContext::initializeViewports ()
{
if (this->m_isRootWindow == false || this->m_screens.empty () == true)
return;
Display* display = XOpenDisplay (nullptr);
int xrandr_result, xrandr_error;
if (!XRRQueryExtension (display, &xrandr_result, &xrandr_error))
{
std::cerr << "XRandr is not present, cannot detect specified screens, running in window mode" << std::endl;
return;
}
int fullWidth = DisplayWidth (display, DefaultScreen (display));
int fullHeight = DisplayHeight (display, DefaultScreen (display));
XRRScreenResources* screenResources = XRRGetScreenResources (display, DefaultRootWindow (display));
// there are some situations where xrandr returns null (like screen not using the extension)
if (screenResources == nullptr)
return;
for (int i = 0; i < screenResources->noutput; i ++)
{
XRROutputInfo* info = XRRGetOutputInfo (display, screenResources, screenResources->outputs [i]);
// there are some situations where xrandr returns null (like screen not using the extension)
if (info == nullptr)
continue;
auto cur = this->m_screens.begin ();
auto end = this->m_screens.end ();
for (; cur != end; cur ++)
{
if (info->connection == RR_Connected && strcmp (info->name, (*cur).c_str ()) == 0)
{
XRRCrtcInfo* crtc = XRRGetCrtcInfo (display, screenResources, info->crtc);
std::cout << "Found requested screen: " << info->name << " -> " << crtc->x << "x" << crtc->y << ":" << crtc->width << "x" << crtc->height << std::endl;
glm::vec4 viewport = {
crtc->x, fullHeight - (crtc->y + crtc->height), crtc->width, crtc->height
};
this->m_viewports.push_back (viewport);
XRRFreeCrtcInfo (crtc);
}
}
XRRFreeOutputInfo (info);
}
XRRFreeScreenResources (screenResources);
// store the window
this->m_window = DefaultRootWindow (display);
// set the
glfwWindowHintPointer (GLFW_NATIVE_PARENT_HANDLE, reinterpret_cast <void*> (DefaultRootWindow (display)));
}
void CContext::render ()
{
if (this->m_wallpaper == nullptr)
return;
if (this->m_viewports.empty () == false)
{
bool firstFrame = true;
auto cur = this->m_viewports.begin ();
auto end = this->m_viewports.end ();
for (; cur != end; cur ++)
{
this->m_wallpaper->render (*cur, firstFrame);
firstFrame = false;
}
}
else
this->m_wallpaper->render ({0, 0, 1920, 1080});
}
void CContext::setWallpaper (CWallpaper* wallpaper)
{
this->m_wallpaper = wallpaper;
}

View File

@ -0,0 +1,26 @@
#pragma once
#include <vector>
#include <glm/vec4.hpp>
#include "CWallpaper.h"
namespace WallpaperEngine::Render
{
class CContext
{
public:
CContext (std::vector <std::string> screens);
void initializeViewports ();
void render ();
void setWallpaper (CWallpaper* wallpaper);
private:
Window m_window;
std::vector <std::string> m_screens;
std::vector <glm::vec4> m_viewports;
CWallpaper* m_wallpaper;
bool m_isRootWindow;
};
}

View File

@ -45,7 +45,7 @@ CCamera* CScene::getCamera () const
return this->m_camera;
}
void CScene::render ()
void CScene::renderFrame ()
{
auto projection = this->getScene ()->getOrthogonalProjection ();
auto cur = this->m_objects.begin ();
@ -66,8 +66,6 @@ void CScene::render ()
// ensure we render over the whole screen
glViewport (0, 0, projection->getWidth (), projection->getHeight ());
CWallpaper::render ();
}
Core::CScene* CScene::getScene ()

View File

@ -19,11 +19,11 @@ namespace WallpaperEngine::Render
CCamera* getCamera () const;
void render () override;
Core::CScene* getScene ();
protected:
void renderFrame () override;
friend class CWallpaper;
static const std::string Type;

View File

@ -114,7 +114,7 @@ void CVideo::setSize (int width, int height)
SWS_BILINEAR, NULL, NULL, NULL);
}
void CVideo::render ()
void CVideo::renderFrame ()
{
// do not render using the CWallpaper function, just use this one
this->setSize (m_codecCtx->width, m_codecCtx->height);

View File

@ -19,11 +19,11 @@ namespace WallpaperEngine::Render
public:
CVideo (Core::CVideo* video, CContainer* container);
void render () override;
Core::CVideo* getVideo ();
protected:
void renderFrame () override;
friend class CWallpaper;
static const std::string Type;

View File

@ -184,8 +184,48 @@ void CWallpaper::setupShaders ()
this->a_TexCoord = glGetAttribLocation (this->m_shader, "a_TexCoord");
}
void CWallpaper::render ()
void CWallpaper::render (glm::vec4 viewport, bool newFrame)
{
if (newFrame == true)
this->renderFrame ();
int windowWidth = 1920;
int windowHeight = 1080;
if (this->getWallpaperData ()->is <WallpaperEngine::Core::CScene> ())
{
auto projection = this->getWallpaperData ()->as <WallpaperEngine::Core::CScene> ()->getOrthogonalProjection ();
windowWidth = projection->getWidth ();
windowHeight = projection->getHeight ();
}
// TODO: SUPPORT VIDEO
float widthRatio = windowWidth / viewport.z;
float heightRatio = windowHeight / viewport.w;
GLfloat position [] = {
widthRatio * -1.0f, heightRatio * 1.0f, 0.0f,
widthRatio * 1.0, heightRatio * 1.0f, 0.0f,
widthRatio * -1.0f, heightRatio * -1.0f, 0.0f,
widthRatio * -1.0f, heightRatio * -1.0f, 0.0f,
widthRatio * 1.0f, heightRatio * 1.0f, 0.0f,
widthRatio * 1.0f, heightRatio * -1.0f, 0.0f
};
glBindBuffer (GL_ARRAY_BUFFER, this->m_positionBuffer);
glBufferData (GL_ARRAY_BUFFER, sizeof (position), position, GL_STATIC_DRAW);
/*
-1.0f, 1.0f, 0.0f,
1.0, 1.0f, 0.0f,
-1.0f, -1.0f, 0.0f,
-1.0f, -1.0f, 0.0f,
1.0f, 1.0f, 0.0f,
1.0f, -1.0f, 0.0f
*/
glViewport (viewport.x, viewport.y, viewport.z, viewport.w);
// write to default's framebuffer
glBindFramebuffer (GL_FRAMEBUFFER, GL_NONE);
@ -244,6 +284,7 @@ void CWallpaper::createFramebuffer (GLuint* framebuffer, GLuint* depthbuffer, GL
windowWidth = projection->getWidth ();
windowHeight = projection->getHeight ();
}
// TODO: SUPPORT VIDEO
GLenum drawBuffers [1] = {GL_COLOR_ATTACHMENT0};
// create the main framebuffer

View File

@ -32,7 +32,7 @@ namespace WallpaperEngine::Render
/**
* Performs a render pass of the wallpaper
*/
virtual void render ();
void render (glm::vec4 viewport, bool newFrame = true);
/**
* @return The container to resolve files for this wallpaper
@ -57,6 +57,11 @@ namespace WallpaperEngine::Render
GLuint getWallpaperTexture () const;
protected:
/**
* Renders a frame of the wallpaper
*/
virtual void renderFrame () = 0;
void createFramebuffer (GLuint* framebuffer, GLuint* depthbuffer, GLuint* texture);
CContainer* m_container;