how can I set 256 colors?

This is a discussion on how can I set 256 colors? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I am using Turbo C 3.0 and I want to set 256 colors in my programme. I have seen several ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    24

    Red face how can I set 256 colors?


    I am using Turbo C 3.0 and I want to set 256 colors in my programme.
    I have seen several systems to do so but they look too hard for me to use!!..
    For example.....

    initgraph() sets us to get 16 color support by default if The card is minimum VGA. so is threre any way to set it to be 256 using such easy functions????
    If there is no way to make it simple like initgraph()....... can anyone make the hard matter simple to me?

    Please help.......I am really in a great problem :0 !!!!
    RaHaTk

  2. #2
    Registered User alex's Avatar
    Join Date
    Sep 2001
    Posts
    132
    I think you can get 320x200 x 256colors using the standard bgi-drivers. But you want hi-res 256color modes I guess. I found a bgidriver called "svga256.bgi" once... but I cannot find it anymore. There aparently exists a package of this kind of drivers called "svgabg55.zip", but this is not freeware.

    Good luck

    PS. take a look at http://www.simtel.net/pub/msdos/borland/

  3. #3
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    Actually, I think the guy that made that package has released the SVGA driver as freeware. If not, you can go to programmersheaven.com and search for a graphics library. Most have simple ways to get into 256 color modes.

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    void SetMode(void)
    {
    union REGS regs;
    regs.x.ax=0x13;
    int86(0x10, & regs, & regs)
    }

    In code, do not space the ampersands. Board screws up ampersands so cannot post correctly.

    This is not hard to do w/o using BGI. Go to www.brackeen.com for more info on VGA programming. Don't use BGI regardless of what video driver you get your hands on.

  5. #5
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    >Don't use BGI regardless of what video driver you get your hands on.<

    BGI is a good graphics library for most purposes. On the other hand, if you're coding a game or a program that demands fast, high resolution primitives, then opt for a different library.

  6. #6
    Registered User Sunny's Avatar
    Join Date
    Nov 2001
    Posts
    101

    Thumbs down Yes, *ahemm* but we still have a problem

    Using the svga256.bgi driver is fine until you want to do anything as simple as using the mouse under DOS. I say if you can read directly from the video memory without having to pass trough the CPU then you've done it. Only thing is i really don't know how that's done *sigh*
    Yes...YES!!! I did it! Ha ha ha...I'm king of the world...No..No..please-wait-no...!!!!-- This program has performed an illegal operation AND WILL be shut down....Ack-Choking..help...ack..

  7. #7
    A Banana Yoshi's Avatar
    Join Date
    Oct 2001
    Posts
    859

    Exclamation Problem!

    You can only do that in dos mode with a dos compiler.
    Yoshi

  8. #8
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    VESA anyone? no brackeen.com exists for it... but it's a great option, granted you can set it up... PM me if you/anyone needs help!
    hasafraggin shizigishin oppashigger...

  9. #9
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    Yes using the LFB from DJGPP is oh so sweet. No bank-switching and access is much faster, albeit a bit more dangerous since I'm not using farnspokeb() or farpokeb(). Only resolution that is still a bit shaky on the framerate side is 1028x764 for direct color modes. Even in PM, DOS does not compare with DirectX and there eventually is a limit on how many triangles I can shoot to the screen per second since I'm not using the graphic hardware directly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 08-19-2007, 09:10 AM
  2. Why I only get 8 colors out of ncurses?
    By Nazgulled in forum C Programming
    Replies: 3
    Last Post: 05-08-2007, 07:06 PM
  3. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  4. The new FAQ
    By Hammer in forum A Brief History of Cprogramming.com
    Replies: 34
    Last Post: 08-30-2006, 11:05 AM
  5. Problem with my file opener
    By kzar in forum C Programming
    Replies: 7
    Last Post: 04-20-2005, 05:20 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21