Page 1 of 1

Graphics

Posted: Sun Jul 04, 2004 8:23 am
by Kyle
How do you draw graphics in PM? In Real Mode it?s easy, using BIOS interrupts, but I wanna make some kinda GUI (with nice menues) and need to do drawing instead of textwriting... Is there some kinda Mode I need to enter or what?

Re:Graphics

Posted: Sun Jul 04, 2004 10:26 am
by Curufir
Switch to a graphical mode and write directly in video memory.

Re:Graphics

Posted: Sun Jul 04, 2004 10:45 am
by Kyle
which are the graphics modes and you know any link where I can read about the switching? thanks

Re:Graphics

Posted: Sun Jul 04, 2004 11:20 am
by Curufir
Well the VGA (And VESA) modes can be selected using the standard BIOS interrupt 0x10 (*So it has to be done in either real-mode or via a vm86 task).

Int 0x10

Seems like a decent enough reference for int 0x10 (No VESA extension).

VESA

Contains the various VESA standards.

Vga is limited to a 640x480x16, VESA (Depending on your card) can present much higher resolutions.

The mechanism for plotting to screen really depends on which graphics mode you are in. The easiest to start playing with (IMHO) is VGA mode 0x13. This is 320x200x256 and has the advantage that every pixel is represented fully by a single byte in video RAM so it's really easy to program for.

Mode 0x13

Should get you up and running pretty quickly with VGA mode 0x13.

*Later versions of VESA BIOS contain functions that can be accessed from protected mode.

Re:Graphics

Posted: Sun Jul 04, 2004 12:01 pm
by Kyle
Ive done pretty much using Mode 13, but I want to do it in protected mode (I dont wanna go back to real mode)...

Re:Graphics

Posted: Sun Jul 04, 2004 12:34 pm
by DennisCGc
Kyle wrote: Ive done pretty much using Mode 13, but I want to do it in protected mode (I dont wanna go back to real mode)...
Maybe you should take a look at this
It contains the code to set the screen to 320x200x256 without using the BIOS.

HTH.