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

ディスプレイサイズの取得

#include <iostream>
#include <SDL.h>
#include "Display_size.h"
#include "SizeF.h"
using namespace hrk;
using namespace std;
int main(int argc, char *argv[])
{
static_cast<void>(argc);
static_cast<void>(argv);
Display_size display_size;
const SizeF current_size = display_size.current_size();
cout << "current_size: "
<< current_size.width() << " x " << current_size.height() << endl;
vector<SizeF> sizes = display_size.sizes();
for (vector<SizeF>::const_iterator it = sizes.begin();
it != sizes.end(); ++it) {
cout << it->width() << " x " << it->height() << endl;
}
return 0;
}