Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e0db59c

Browse filesBrowse files
committed
merged in latest io2d/master
2 parents 8b4beb3 + 5c9e910 commit e0db59c
Copy full SHA for e0db59c

File tree

Expand file treeCollapse file tree

3 files changed

+16
-28
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+16
-28
lines changed

‎.gitignore

Copy file name to clipboardExpand all lines: .gitignore
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,4 @@ P0267_RefImpl/dll_Release
258258
*.db-wal
259259
/P0267_RefImpl/SampleApp
260260
/CMakeSettings.json
261+
.vscode
+6-8Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
cmake_minimum_required(VERSION 3.0.0)
2-
project(io2d CXX)
3-
42
set(CMAKE_CXX_STANDARD 17)
53

6-
add_executable(color_fill main.cpp)
7-
8-
target_link_libraries(color_fill io2d)
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})
98

10-
install(TARGETS color_fill
11-
RUNTIME DESTINATION ${CMAKE_BINARY_DIR}/samples
12-
)
9+
add_executable(${PROJECT_ID} main.cpp)
10+
target_link_libraries(${PROJECT_ID} io2d)

‎P0267_RefImpl/Samples/color_fill/main.cpp

Copy file name to clipboardExpand all lines: P0267_RefImpl/Samples/color_fill/main.cpp
+9-20Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,15 @@
33

44
using namespace std::experimental::io2d;
55

6-
static output_surface & display() {
7-
static auto surface = output_surface {512, 512, format::argb32, scaling::none, refresh_style::fixed, 30.f};
8-
return surface;
9-
}
10-
116
int main(int argc, const char *argv[]) {
12-
try {
13-
auto &d = display();
14-
d.size_change_callback([&](output_surface &surface) {
15-
surface.dimensions(surface.display_dimensions());
16-
});
17-
d.draw_callback([&](auto &surface) {
18-
brush mainColor {rgba_color::green};
19-
surface.paint(mainColor);
20-
});
21-
d.begin_show();
22-
} catch (const std::exception &ex) {
23-
printf("std::exception caught, what=\"%s\"\n", ex.what());
24-
} catch (...) {
25-
printf("unknown exception caught\n");
26-
}
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();
2716
return 0;
2817
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.