Recent

Author Topic: [solved] my windows app opens two windows instead of one?  (Read 2425 times)

billyb123

  • New Member
  • *
  • Posts: 26
[solved] my windows app opens two windows instead of one?
« on: November 19, 2017, 03:43:59 am »
when i compile and start my sdl2 game in linux everything works fine,
but when i compile it on windows, when i start it TWO windows appear on the screen, my game screen, and one empty (black) windows console screen.
if i do ctrl+c in that blank console screen my app dies in the other screen.

my sdl2 code is normal, only one window is created in code.
does anyone know why this happens and how to remove that console screen? i only want one window to appear when i start my app (just like in linux and bsd).

(i dont use lazarus, only pure fpc)
« Last Edit: November 19, 2017, 03:47:14 am by billyb123 »

billyb123

  • New Member
  • *
  • Posts: 26
Re: my windows app opens two windows instead of one?
« Reply #1 on: November 19, 2017, 03:46:55 am »
ok, google solved it - i compiled my app with "-WG" and console window disappeared

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: [solved] my windows app opens two windows instead of one?
« Reply #2 on: November 19, 2017, 11:09:55 am »
You can also add:
Code: Pascal  [Select][+][-]
  1. program mygame;
  2. {$IFDEF WINDOWS} {$APPTYPE GUI}{$ENDIF}
in your sourcecode
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

 

TinyPortal © 2005-2018