Skip to content

Commit e07401f

Browse files
committed
new sample: color_fill
This is an attempt to create a minimal-as-possible (within reason?) sample app. All this sample does is display a green window.
1 parent 01204c3 commit e07401f

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cmake_minimum_required(VERSION 3.0.0)
2+
set(CMAKE_CXX_STANDARD 17)
3+
4+
# Use the CMakeLists.txt's parent-directory-name for the project's id/name
5+
get_filename_component(PROJECT_ID ${CMAKE_CURRENT_SOURCE_DIR} NAME)
6+
string(REPLACE " " "_" PROJECT_ID ${PROJECT_ID})
7+
project(${PROJECT_ID})
8+
9+
add_executable(${PROJECT_ID} main.cpp)
10+
target_link_libraries(${PROJECT_ID} io2d)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
#include <io2d.h>
3+
4+
using namespace std::experimental::io2d;
5+
6+
int main(int argc, const char *argv[]) {
7+
auto display = output_surface {512, 512, format::argb32, scaling::none, refresh_style::fixed, 30.f};
8+
display.size_change_callback([&](output_surface &surface) {
9+
surface.dimensions(surface.display_dimensions());
10+
});
11+
display.draw_callback([&](auto &surface) {
12+
brush mainColor {rgba_color::green};
13+
surface.paint(mainColor);
14+
});
15+
display.begin_show();
16+
return 0;
17+
}

0 commit comments

Comments
 (0)