Compare commits
5 commits
480a087d8e
...
8f879bae39
| Author | SHA1 | Date | |
|---|---|---|---|
| 8f879bae39 | |||
| 047c48e670 | |||
| ce4fc68fe2 | |||
| b97651ab1d | |||
| 18a0676f16 |
3 changed files with 47 additions and 6 deletions
|
|
@ -13,5 +13,14 @@ add_subdirectory(psemek)
|
|||
file(GLOB_RECURSE GMTK_SOURCES LIST_DIRECTORIES FALSE "${CMAKE_CURRENT_SOURCE_DIR}/source/*")
|
||||
file(GLOB_RECURSE GMTK_HEADERS LIST_DIRECTORIES FALSE "${CMAKE_CURRENT_SOURCE_DIR}/include/*")
|
||||
|
||||
psemek_add_application(color-fractory ${GMTK_SOURCES} ${GMTK_HEADERS})
|
||||
psemek_package_files(color-fractory sounds)
|
||||
set(TARGET_NAME color-fractory)
|
||||
psemek_add_application(${TARGET_NAME} ${GMTK_SOURCES} ${GMTK_HEADERS})
|
||||
psemek_package_files(${TARGET_NAME} sounds)
|
||||
if(TARGET color-fractory)
|
||||
if(PSEMEK_PLATFORM_WEB)
|
||||
# Required by itch.io
|
||||
set_target_properties(${TARGET_NAME} PROPERTIES
|
||||
OUTPUT_NAME "index"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
|||
2
psemek
2
psemek
|
|
@ -1 +1 @@
|
|||
Subproject commit b989eba66de743692532c5f0aace97be9f3a8041
|
||||
Subproject commit 34c1a92f0be271815584400635dbc5462e0589ed
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
#include <psemek/app/default_application_factory.hpp>
|
||||
#include <psemek/gfx/gl.hpp>
|
||||
#include <psemek/gfx/painter.hpp>
|
||||
#include <psemek/gfx/framebuffer.hpp>
|
||||
#include <psemek/gfx/renderbuffer.hpp>
|
||||
#include <psemek/util/array.hpp>
|
||||
#include <psemek/random/generator.hpp>
|
||||
#include <psemek/random/device.hpp>
|
||||
|
|
@ -1503,6 +1505,8 @@ namespace gmtk
|
|||
pop_ = audio::load_mp3(io::read_full(std::move(*app::open_resource("sounds/pop.mp3"))));
|
||||
error_ = audio::load_mp3(io::read_full(std::move(*app::open_resource("sounds/error.mp3"))));
|
||||
|
||||
resolve_texture_.nearest_filter();
|
||||
|
||||
context_.windowed(is_windowed_);
|
||||
init_menu();
|
||||
}
|
||||
|
|
@ -1510,6 +1514,14 @@ namespace gmtk
|
|||
void on_event(app::resize_event const & event) override
|
||||
{
|
||||
screen_size_ = event.size;
|
||||
|
||||
multisample_renderbuffer_.storage<gfx::color_rgba>(math::cast<std::size_t>(event.size), 4);
|
||||
multisample_framebuffer_.color(multisample_renderbuffer_);
|
||||
multisample_framebuffer_.assert_complete("multisample");
|
||||
|
||||
resolve_texture_.load<gfx::color_rgba>(math::cast<std::size_t>(event.size));
|
||||
resolve_framebuffer_.color(resolve_texture_);
|
||||
resolve_framebuffer_.assert_complete("resolve");
|
||||
}
|
||||
|
||||
void on_event(app::touch_down_event const & event) override
|
||||
|
|
@ -1872,7 +1884,7 @@ namespace gmtk
|
|||
|
||||
map_.world->apply<vertex const, transformer>([&](vertex const & v, transformer & t)
|
||||
{
|
||||
boost::container::flat_multimap<resource_type, location> has_inputs;
|
||||
std::multimap<resource_type, location> has_inputs;
|
||||
|
||||
auto c = v.location.down();
|
||||
auto ce = map_.world->index<path_index>().get(c);
|
||||
|
|
@ -2144,6 +2156,8 @@ namespace gmtk
|
|||
|
||||
void present() override
|
||||
{
|
||||
multisample_framebuffer_.bind();
|
||||
|
||||
gl::ClearColor(1.f, 1.f, 1.f, 1.f);
|
||||
gl::Clear(gl::COLOR_BUFFER_BIT);
|
||||
|
||||
|
|
@ -2290,7 +2304,7 @@ namespace gmtk
|
|||
|
||||
if (selected_card_ || active_card_)
|
||||
{
|
||||
if (auto type = card_to_transformer(selected_card_.value_or(*active_card_)))
|
||||
if (auto type = card_to_transformer(selected_card_ ? *selected_card_ : *active_card_))
|
||||
shown_recipies = *type;
|
||||
}
|
||||
else if (selected_)
|
||||
|
|
@ -2376,7 +2390,7 @@ namespace gmtk
|
|||
}
|
||||
|
||||
if (selected_card_ || active_card_)
|
||||
helper_text = card_description(selected_card_.value_or(*active_card_));
|
||||
helper_text = card_description(selected_card_ ? *selected_card_ : *active_card_);
|
||||
else if (selected_)
|
||||
if (auto entity = map_.world->index<index>().find(*selected_))
|
||||
{
|
||||
|
|
@ -2548,6 +2562,17 @@ namespace gmtk
|
|||
}
|
||||
|
||||
painter_.render(math::orthographic_camera{view_box_}.transform());
|
||||
|
||||
multisample_framebuffer_.bind_read();
|
||||
resolve_framebuffer_.bind();
|
||||
|
||||
gl::Clear(gl::COLOR_BUFFER_BIT);
|
||||
gl::BlitFramebuffer(0, 0, screen_size_[0], screen_size_[1], 0, 0, screen_size_[0], screen_size_[1], gl::COLOR_BUFFER_BIT, gl::NEAREST);
|
||||
|
||||
gfx::framebuffer::null().bind();
|
||||
|
||||
painter_.texture(resolve_texture_, {{{-1.f, 1.f}, {-1.f, 1.f}}});
|
||||
painter_.render(math::matrix<float, 4, 4>::identity());
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
@ -2746,6 +2771,12 @@ namespace gmtk
|
|||
|
||||
gfx::painter painter_;
|
||||
|
||||
gfx::framebuffer multisample_framebuffer_;
|
||||
gfx::renderbuffer multisample_renderbuffer_;
|
||||
|
||||
gfx::framebuffer resolve_framebuffer_;
|
||||
gfx::texture_2d resolve_texture_;
|
||||
|
||||
struct view_transition
|
||||
{
|
||||
location old;
|
||||
|
|
@ -2937,6 +2968,7 @@ namespace psemek::app
|
|||
application::options options
|
||||
{
|
||||
.name = "Color Fractory",
|
||||
.multisampling = 0,
|
||||
};
|
||||
|
||||
return default_application_factory<gmtk::application>(options);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue