Hello world!

Hello world! と描画し続けます。

  1. #include "dxlibp.h"
  2. PSP_MODULE_INFO("DXP hello world!", 0, 1, 1);
  3. PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);
  4. int main()
  5. {
  6. if(DxLib_Init() == -1)return -1;
  7. while(ProcessMessage() != -1)
  8. {
  9. ClearDrawScreen();
  10. printfDx("hello world!\n");
  11. ScreenFlip();
  12. }
  13. DxLib_End();
  14. return 0;
  15. }


Hello world! 2

  1. #include "dxlibp.h"
  2. PSP_MODULE_INFO("DXP hello world!", 0, 1, 1);
  3. PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);
  4. int main()
  5. {
  6. if(DxLib_Init() == -1)return -1;
  7. while(ProcessMessage() != -1)
  8. {
  9. ClearDrawScreen();
  10. DrawString("Hello world!",100,100,0xffffffff,0);
  11. ScreenFlip();
  12. }
  13. DxLib_End();
  14. return 0;
  15. }

画像描画の基本

poe.pngをロードして画面に表示します。

  1. #include "dxlibp.h"
  2. PSP_MODULE_INFO("DXP DrawGraph Sample", 0, 1, 1);
  3. PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER);
  4. int main()
  5. {
  6. int gh;
  7. if(DxLib_Init() == -1)return -1;
  8. gh = LoadGraph("poe.png");
  9. while(ProcessMessage() != -1)
  10. {
  11. ClearDrawScreen();
  12. DrawGraph(100,100,gh,0);
  13. ScreenFlip();
  14. }
  15. DxLib_End();
  16. return 0;
  17. }