Recent

Author Topic: Problem to activate the Full Screen mode 320x200x256  (Read 8497 times)

carlejt

  • New Member
  • *
  • Posts: 39
Problem to activate the Full Screen mode 320x200x256
« on: July 23, 2010, 04:01:13 am »
Hello. How do I activate the 320x200x256 graphics mode (full screen) with the compiler FPC 2.2.4 in Lazarus 0.9.28.2?.

Note: In other compilers use asm mov ax, 13h; Intl 10h; end, and "to plot a pixel [x, y]" mem [$a000:320*y+x]:=color;

If perhaps there is no solution in full screen, Is there a "graphics mode" or "Window" to plot a pixel, provided that the procedure to plot (Pixel) should be is as fast possible in its execution?
"If so, ¿Which?, ¿how active?, and ¿what is the procedure for "plot a pixel?

Thanks.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8799
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Problem to activate the Full Screen mode 320x200x256
« Reply #1 on: July 23, 2010, 02:34:44 pm »
Quote
In other compilers use asm mov ax, 13h; Intl 10h; end, and "to plot a pixel [x, y]" mem [$a000:320*y+x]:=color;
Wow! 16-bit code... :o
AFAIK This won't work in FPC, or any other 32-bit compiler without jumping back from protected mode to real mode. First, you're calling BIOS interrupt (you MUSt call it from real mode). Second, modern OSes doesn't allow direct video memory access. Construct like: mem[$a000:320*y+x] will refer $a000 from YOUR application virtual memory instead of the real $a000.
Quote
If perhaps there is no solution in full screen, Is there a "graphics mode" or "Window" to plot a pixel, provided that the procedure to plot (Pixel) should be is as fast possible in its execution?
Each OSes provides its own way to activate full screen mode, for example, Windows API has ChangeDisplaySettings function. You can plot anywhere in your form, just set Canvas.Pixels property. And if you need speed, call BeginFormUpdate before doing the plot and call EndFormUpdate after finishing it.

BlueIcaro

  • Hero Member
  • *****
  • Posts: 818
    • Blog personal
Re: Problem to activate the Full Screen mode 320x200x256
« Reply #2 on: July 23, 2010, 03:37:13 pm »
Hello, in windows you need use DirectX or OpenGl, try to use a library like Allegro.pas

http://allegro-pas.sourceforge.net/ it's works with Lazarus.

I think you posted the same problem (also the same user) at Hispalazarus (Spanish lazarus forum). I wrote you, also at there.

/BlueIcaro

carlejt

  • New Member
  • *
  • Posts: 39
Re: Problem to activate the Full Screen mode 320x200x256
« Reply #3 on: July 23, 2010, 04:49:13 pm »
Leledumbo thank very much. But the procedure is slow. FORM Fill a 300x400 takes 1/2 second. Is there something faster or not?

Thanks BlueIcaro. Through DirectX. What is the procedure to plot a pixel?. And another thing Is it fast?

BlueIcaro

  • Hero Member
  • *****
  • Posts: 818
    • Blog personal
Re: Problem to activate the Full Screen mode 320x200x256
« Reply #4 on: July 25, 2010, 11:17:20 am »
Hello, I don't have any experince about this issue. But you can find may information in the web. Also you can try SDL library, if you did a search in this forum, you will find some posts talking about it.

SDL is a library written in C, and their headers was transalate for use in Delphi by Jedy Project, and as I read here, it can works with Lazarus

http://www.delphi-jedi.org/

Here, there is a lot good examples http://delphiallimite.blogspot.com/search/label/gr%C3%A1ficos, if you spend some time in this web, you will find some examples that works with a directX, and other with OpenGl.

/BlueIcaro


Leledumbo

  • Hero Member
  • *****
  • Posts: 8799
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Problem to activate the Full Screen mode 320x200x256
« Reply #5 on: July 26, 2010, 09:37:44 am »
Quote
FORM Fill a 300x400 takes 1/2 second. Is there something faster or not?
Try set DoubleBuffered to true or use DirectX or OpenGL. I never use DirectX so I can't tell anything about it, and OpenGL relies on host platform (your graphic card counts) ability to render graphics. You can use OpenGL with lazopenglcontext package under components directory, google on how to put a pixel. Don't forget to set DoubleBuffered to true or you may get flickers (for complex calculation).

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1206
    • Burdjia
Re: Problem to activate the Full Screen mode 320x200x256
« Reply #6 on: July 27, 2010, 12:43:43 pm »
May be you can use Allegro.pas. 8)
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

 

TinyPortal © 2005-2018