SVGA setpixel

Topics: Using Cosmos (Developing your own OS, projects, etc)
Sep 8, 2012 at 11:50 PM

OK. I fixed svga. Well, the clear(). but setpixel needs help.

Sep 9, 2012 at 1:19 AM
jpal wrote:

OK. I fixed svga. Well, the clear(). but setpixel needs help.

Are you setting the right resolution? Also I assume you are using someone elses code right?

Sep 9, 2012 at 11:43 AM

resolution 640x400. And this is the code:

    class SVGA

    {

        public static size res = new size(640,400);

        public static Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII svga = new Cosmos.Hardware.Drivers.PCI.Video.VMWareSVGAII();

        public static void setres(int par1, int par2)

        {

            res = new size(par1, par2);

            svga.SetMode((ushort)par1, (ushort)par2, 32);

        }

        public static size getres()

        {

            return res;

        }

        public static void set(int x, int y, uint col)

        {

            svga.SetPixel((ushort)x, (ushort)y, col);

        }

        public static uint get(int x, int y)

        {

            return svga.GetPixel((ushort)x, (ushort)y);

        }

 

        public static void clear(uint par1)

        {

            svga.Clear((uint)par1);

        }

        public static void update()

        {

            svga.Update((ushort)0, (ushort)0, (ushort)res.width, (ushort)res.height);

        }

    }

Developer
Jan 20, 2013 at 9:19 AM

Hi

Me too Clear() works, but SetPixel does nothing.

Developer
Jan 28, 2013 at 5:56 AM
Edited Jan 28, 2013 at 5:56 AM

You are remembering to use update() after you draw anything right?

 

Also for more SVGA stuff a copy of the Pear OS source is here: http://cosmosalliance.tk/Upload/showthread.php?tid=86&highlight=Pear+OS

Jan 31, 2013 at 4:41 AM
The download to the PearOS source on OCA is broken :(
Jan 31, 2013 at 5:03 AM
Edited Jan 31, 2013 at 5:05 AM
stevenator wrote:
The download to the PearOS source on OCA is broken :(
Im glad, it should be. That code is not their's to distribute. But if you really wan't something just wait a little while.. I have been working on a C# Kernel, and Compiler and have made leaps and bounds. I think soon it will be stable enough to build a full blown os in. Its non Cosmos based.. But..