Advertisement
Guest User

Untitled

a guest
Sep 20th, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.87 KB | None | 0 0
  1. helloworld.cpp
  2. ==============
  3. 1 #include "irrlicht/irrlicht.h"
  4. 2
  5. 3 using namespace irr;
  6. 4
  7. 5 using namespace core;
  8. 6 using namespace scene;
  9. 7 using namespace video;
  10. 8 using namespace io;
  11. 9 using namespace gui;
  12. 10
  13. 11 int main() {
  14. 12 IrrlichtDevice *device =
  15. 13 createDevice(video::EDT_SOFTWARE, dimension2d<u32>(640,480), 16,
  16. 14 false, false, false, 0);
  17. 15
  18. 16 if (!device) return 1;
  19. 17
  20. 18 device->setWindowCaption(L"Hello World! - Irrlicht Engine");
  21. 19
  22. 20 IVideoDriver* driver = device->getVideoDriver();
  23. 21 ISceneManager* smgr = device->getSceneManager();
  24. 22 IGUIEnvironment* guienv = device->getGUIEnvironment();
  25. 23
  26. 24 guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer.", rect<s32>(10, 10,260,22), true);
  27. 25
  28. 26 IAnimatedMesh* mesh=smgr->getMesh("sydney.md2");
  29. 27 if (!mesh) {
  30. 28 device->drop();
  31. 29 return 1;
  32. 30 }
  33. 31 IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh);
  34. 32
  35. 33 if (node) {
  36. 34 node->setMaterialFlag(EMF_LIGHTING, false);
  37. 35 node->setMD2Animation(scene::EMAT_STAND);
  38. 36 node->setMaterialTexture(0,driver->getTexture("sydney.bmp") );
  39. 37
  40. 38 }
  41. 39
  42. 40 smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
  43. 41
  44. 42 while(device->run() ) {
  45. 43 driver->beginScene(true,true,SColor(255,100,101,140));
  46. 44 smgr->drawAll();
  47. 45 guienv->drawAll();
  48. 46 driver->endScene();
  49. 47 }
  50. 48
  51. 49 device->drop();
  52. 50 return 0;
  53. 51 }
  54.  
  55.  
  56. Invocation (also same output under cmd.exe)
  57. ==========
  58. Tarinaky@Mercury /cygdrive/c/src/irrlicht_tutorial
  59. $ which mingw32-g++.exe
  60. /cygdrive/c/MinGW/bin/mingw32-g++.exe
  61.  
  62. Tarinaky@Mercury /cygdrive/c/src/irrlicht_tutorial
  63. $ mingw32-g++ -v helloworld.cpp -Llib/Win32-gcc -lIrrlicht
  64. Using built-in specs.
  65. COLLECT_GCC=C:\MinGW\bin\mingw32-g++.exe
  66. COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe
  67. Target: mingw32
  68. Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
  69. Thread model: win32
  70. gcc version 4.6.2 (GCC)
  71. COLLECT_GCC_OPTIONS='-v' '-Llib/Win32-gcc' '-shared-libgcc' '-mtune=i386' '-march=i386'
  72. c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/cc1plus.exe -quiet -v -iprefix c:\mingw\bin\../lib/gcc/mingw32/4.6.2/ helloworld.cpp -quiet -dumpbase helloworld.cpp -mtune=i386 -march=i386 -auxbase helloworld -version -o C:\cygwin\tmp\ccLcpVsa.s
  73. GNU C++ (GCC) version 4.6.2 (mingw32)
  74. compiled by GNU C version 4.6.2, GMP version 5.0.1, MPFR version 2.4.1, MPC version 0.8.1
  75. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
  76. ignoring nonexistent directory "c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../mingw32/include"
  77. ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.6.2/include/c++"
  78. ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.6.2/include/c++/mingw32"
  79. ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.6.2/include/c++/backward"
  80. ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.6.2/include"
  81. ignoring duplicate directory "/mingw/lib/gcc/mingw32/4.6.2/../../../../include"
  82. ignoring duplicate directory "c:/mingw/lib/gcc/../../include"
  83. ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.6.2/include-fixed"
  84. ignoring nonexistent directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.6.2/../../../../mingw32/include"
  85. ignoring duplicate directory "/mingw/include"
  86. #include "..." search starts here:
  87. #include <...> search starts here:
  88. c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++
  89. c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/mingw32
  90. c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/backward
  91. c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include
  92. c:\mingw\bin\../lib/gcc/mingw32/4.6.2/../../../../include
  93. c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include-fixed
  94. End of search list.
  95. GNU C++ (GCC) version 4.6.2 (mingw32)
  96. compiled by GNU C version 4.6.2, GMP version 5.0.1, MPFR version 2.4.1, MPC version 0.8.1
  97. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
  98. Compiler executable checksum: f7eb4168c2cf10318cc29da8d23b7f3c
  99. COLLECT_GCC_OPTIONS='-v' '-Llib/Win32-gcc' '-shared-libgcc' '-mtune=i386' '-march=i386'
  100. c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/as.exe -o C:\cygwin\tmp\cc6WMDme.o C:\cygwin\tmp\ccLcpVsa.s
  101. COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/;c:/mingw/bin/../libexec/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/
  102. LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/4.6.2/;c:/mingw/bin/../lib/gcc/;c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/lib/;c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../;/mingw/lib/
  103. COLLECT_GCC_OPTIONS='-v' '-Llib/Win32-gcc' '-shared-libgcc' '-mtune=i386' '-march=i386'
  104. c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/collect2.exe -Bdynamic -u ___register_frame_info -u ___deregister_frame_info c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/4.6.2/crtbegin.o -Llib/Win32-gcc -Lc:/mingw/bin/../lib/gcc/mingw32/4.6.2 -Lc:/mingw/bin/../lib/gcc -Lc:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/lib -Lc:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../.. -L/mingw/lib C:\cygwin\tmp\cc6WMDme.o -lIrrlicht -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt c:/mingw/bin/../lib/gcc/mingw32/4.6.2/crtend.o
  105.  
  106. Tarinaky@Mercury /cygdrive/c/src/irrlicht_tutorial
  107. $ gdb a.exe
  108. GNU gdb (GDB) 7.3.50.20111026-cvs (cygwin-special)
  109. Copyright (C) 2011 Free Software Foundation, Inc.
  110. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  111. This is free software: you are free to change and redistribute it.
  112. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  113. and "show warranty" for details.
  114. This GDB was configured as "i686-cygwin".
  115. For bug reporting instructions, please see:
  116. <http://www.gnu.org/software/gdb/bugs/>...
  117. Reading symbols from /cygdrive/c/src/irrlicht_tutorial/a.exe...done.
  118. (gdb) run
  119. Starting program: /cygdrive/c/src/irrlicht_tutorial/a.exe
  120. [New Thread 4144.0x898]
  121. warning: Irrlicht Engine version 1.8.0
  122. warning: Microsoft Windows 7 Professional Edition Service Pack 1 (Build 7601)
  123. warning: Resizing window (640 480)
  124.  
  125. Program received signal SIGSEGV, Segmentation fault.
  126. 0x0040144c in main ()
  127. (gdb) bt
  128. #0 0x0040144c in main ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement