IRRLICHT は,C 言語ベースの3次元エンジンです. IRRLICHT は,画像(カラー,モノクロ)の描画、2次元グラフィックス、3次元グラフィックス,イベント処理(マウス,キーボード等)の機能をもったゲームエンジンの決定版です. 文字の描画 (unicodeも可), 画像ファイル読み書きの機能もありますし,スライダやボタンなどのGUI部品もあるので,困ることはありません.
【関連する外部ページ】: http://lesson.ifdef.jp/index.html ・・・ Irrlicht プログラム集
【外部ページへのリンク】 http://www.zgock-lab.net/irrlicht/tut01.htm
【外部ページへのリンク】 https://irrlichtstg.ifdef.jp/
【外部ページへのリンク】http://www.realintegrity.net/~irr/index.php?FrontPage
Irrlicht のインストールが終わっていること.
Irrlicht のインストールが終わっていること.
Irrlicht を使ってウインドウを開くだけのプログラムです.ウインドウサイズ,背景色,タイトルなどは簡単に変更できる.
#ifdef WIN32 #include<windows.h> #endif #include<irrlicht.h> using namespace irr; using namespace core; using namespace scene; using namespace video; using namespace io; using namespace gui; #pragma comment(lib, "Irrlicht.lib") #ifdef WIN32 INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT ) #else int main() #endif { const int width = 640; const int height = 480; // start up an engine video::E_DRIVER_TYPE driverType; #ifdef WIN32 driverType = video::EDT_DIRECT3D9; #else /* driverType = video::EDT_OPENGL; */ driverType = video::EDT_SOFTWARE; /* driverType = video::EDT_SOFTWARE2; */ #endif static IrrlichtDevice *device = createDevice( driverType, /* windowSize */ core::dimension2d<u32>(width, height), /* bits */ 16, /* fullscreen */ false, /* stencilbuffer */ false, /* vsync */ false, /* IEventReceiver */ 0 ); if (device == 0) return 1; video::IVideoDriver* driver = device->getVideoDriver(); scene::ISceneManager* scenemgr = device->getSceneManager(); gui::IGUIEnvironment* guienv = device->getGUIEnvironment(); gui::IGUIFont* font = guienv->getBuiltInFont(); device->setWindowCaption(L"simple test"); // draw everything while(device->run() && driver) { driver->beginScene(true, true, video::SColor(255,0,0,255)); /* scenemgr->drawAll(); */ driver->endScene(); } // delete device device->drop(); return 0; }
Ubuntu でのコンパイル操作の手順例
g++ -I/usr/include/irrlicht hoge.cc -lIrrlicht