Graphics

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Kyle

Graphics

Post 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?
Curufir

Re:Graphics

Post by Curufir »

Switch to a graphical mode and write directly in video memory.
Kyle

Re:Graphics

Post by Kyle »

which are the graphics modes and you know any link where I can read about the switching? thanks
Curufir

Re:Graphics

Post 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.
Kyle

Re:Graphics

Post 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)...
DennisCGc

Re:Graphics

Post 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.
Post Reply