趣味で作ってるロボット用ソフトウェア
 All Classes Files Functions Enumerations Enumerator Friends Pages
toggle_screen_example.cpp

画面のトグル

#include <iostream>
#include <SDL.h>
#include "Main_window.h"
#include "View.h"
#include "Scene.h"
#include "Layer.h"
#include "Label.h"
#include "Image_surface.h"
#include "delay.h"
using namespace hrk;
using namespace std;
int main(int argc, char *argv[])
{
static_cast<void>(argc);
static_cast<void>(argv);
Main_window main_window;
if (!main_window.show(SizeF(640, 480))) {
cout << "Screen::show(): " << main_window.what() << endl;
return 1;
}
View view(main_window);
Scene* scene = view.front();
Layer* layer = scene->front();
// 矩形を配置
Image_surface surface("png_image.png");
Label label(&surface);
label.set_position(PointF(220, 120));
layer->push_front(&label);
main_window.set_fullscreen(true);
view.redraw();
delay_sec(5.0);
main_window.set_fullscreen(false);
view.redraw();
delay_sec(5.0);
#if 1
main_window.set_fullscreen(true);
view.redraw();
delay_sec(5.0);
//exit(0);
#endif
return 0;
}