1 | #include <iostream> |
---|---|
2 | #include <sstream> |
3 | #include <fstream> |
4 | |
5 | #include "sdl_painter_demo.hpp" |
6 | #include "simple_time.hpp" |
7 | #include "PanZoomTracker.hpp" |
8 | #include "read_path.hpp" |
9 | #include "ImageLoader.hpp" |
10 | #include "colorstop_command_line.hpp" |
11 | |
12 | using namespace fastuidraw; |
13 | |
14 | class painter_simple_test:public sdl_painter_demo |
15 | { |
16 | public: |
17 | painter_simple_test(void) |
18 | {} |
19 | |
20 | protected: |
21 | void |
22 | draw_frame(void); |
23 | |
24 | void |
25 | handle_event(const SDL_Event &ev); |
26 | }; |
27 | |
28 | void |
29 | painter_simple_test:: |
30 | handle_event(const SDL_Event &ev) |
31 | { |
32 | switch(ev.type) |
33 | { |
34 | case SDL_QUIT: |
35 | end_demo(0); |
36 | break; |
37 | } |
38 | } |
39 | |
40 | void |
41 | painter_simple_test:: |
42 | draw_frame(void) |
43 | { |
44 | m_painter->begin(m_surface, Painter::y_increases_downwards); |
45 | |
46 | fastuidraw::PainterBrush transparentYellow; |
47 | transparentYellow.color(1.0f, 1.0f, 0.0f, 0.5f); |
48 | m_painter->fill_rect(fastuidraw::PainterData(&transparentYellow), |
49 | fastuidraw::Rect().size(fastuidraw::vec2(dimensions()))); |
50 | m_painter->end(); |
51 | fastuidraw_glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); |
52 | fastuidraw_glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); |
53 | m_surface->blit_surface(GL_NEAREST); |
54 | } |
55 | |
56 | int |
57 | main(int argc, char **argv) |
58 | { |
59 | painter_simple_test P; |
60 | return P.main(argc, argv); |
61 | } |
62 |