added camera implementation and plenty of other rendering related stuff - splitted out the initialization of the render context

This commit is contained in:
Hartmut Seichter 2018-12-30 23:36:53 +01:00
parent ae37273021
commit f7043fc0cb
43 changed files with 23280 additions and 15161 deletions

26
src/visual/CMakeLists.txt Normal file
View file

@ -0,0 +1,26 @@
set(hdrs
include/pw/visual/renderer.hpp
include/pw/visual/context.hpp
)
set(srcs
src/renderer.cpp
src/context.cpp
)
add_library(pwvisual
STATIC
${hdrs}
${srcs}
)
target_include_directories(
pwvisual
PUBLIC
include
)
target_link_libraries(pwvisual pwscene)
#add_subdirectory(tests)

View file

@ -0,0 +1,25 @@
#ifndef PW_VISUAL_CONTEXT_HPP
#define PW_VISUAL_CONTEXT_HPP
#include <pw/scene/component.hpp>
namespace pw {
class context {
public:
struct size {
int width,height;
};
virtual bool make_current() = 0;
virtual void resize() = 0;
virtual size size() = 0;
virtual void flush() = 0;
virtual ~context() = default;
};
}
#endif

View file

@ -0,0 +1,19 @@
#ifndef PW_VISUAL_RENDERER_HPP
#define PW_VISUAL_RENDERER_HPP
#include <pw/scene/component.hpp>
namespace pw {
class context;
class renderer {
void render(context& context);
};
}
#endif

View file

View file

@ -0,0 +1,9 @@
#include "pw/visual/renderer.hpp"
namespace pw {
void renderer::render(pw::context &context)
{
}
}