CosmosOS / Cosmos

Cosmos is an operating system "construction kit". Build your own OS using managed languages such as C#, VB.NET, and more!
https://www.goCosmos.org
BSD 3-Clause "New" or "Revised" License
2.85k stars 536 forks source link

Problem with VGAScreen hasn't definitions "ScreenSize" and "ColorDepth" and "GetFrameBuffer" #2999

Open DeafMan1983 opened 4 weeks ago

DeafMan1983 commented 4 weeks ago

Hello,

I can't find definitions for VGAScreen because I really want to write an example with my own. But "ChatGPT" helped me an excellent example.

But I really don't understand where is full documentation if I understand correct for definitions of VGAScreen:

using System;
using Cosmos.System.Graphics;

namespace CosmosGraphicsExample
{
    public class Program : Cosmos.System.Kernel
    {
        protected override void BeforeRun()
        {
            // Set VGA graphics mode (320x200, 8-bit color depth)
            VGAScreen.SetGraphicsMode(VGAScreen.ScreenSize.Size320x200, VGAScreen.ColorDepth.BitDepth8);

            // Logic ...
        }

        // Run ...

    }
}

What's it becoming to new version of latest Cosmos? Because Visual Studio got red underlines cause VGAScreen hasn't definitions.

Because I am exticed to test with Cosmos. Thank you!

Thank so much!

zarlo commented 4 weeks ago

VGAScreen is for text mode https://cosmosos.github.io/api/cosmos/Cosmos.System.Graphics.VGAScreen.html

https://cosmosos.github.io/api/cosmos/Cosmos.System.Graphics.FullScreenCanvas.html#Cosmos_System_Graphics_FullScreenCanvas_GetCurrentFullScreenCanvas is what you likely want https://cosmosos.github.io/articles/Kernel/CGS.html

DeafMan1983 commented 4 weeks ago

But I would like to access GetFrameBuffers or GetPixels and SetPixels for custom pixels like SDL2's pixels. uint[] GetPixels should rename from GetFrameBuffers.

Because some developers want to use Software Rasterization or Rendering on own OS.

Please get back Pixels/Framebuffers getter + setter to newest version of CosmosOS. Thanks

zarlo commented 4 weeks ago

if you want access to the framebuffer you have to use the low level drivers that the Canvas system uses

there is GetPointColor and DrawPoint for single pixel