Hi,
blm768 wrote:What I was planning to make was a very minimal driver for each card that would support changing video modes and drawing through an unaccelerated framebuffer-like interface. If 2D acceleration isn't hard to implement in a driver, though, I might add it.
My advice is to forget about implementing drivers, and concentrate on writing a specification that defines the video driver interface. For example, your specification might have 8 functions:
- a function to get a the driver's identification and capabilities (if it supports various optional features or not)
- a function to get a list of supported video modes
- a function to get information about a specific video mode
- a function to set a video mode
- a function to draw a frame of video
- a function to determine what "object ID" happens to be at a specific coordinate (that software can use to determine what part of which icon/widget/window the mouse clicked on)
- a function to set the mouse pointer position
- a function to set the mouse pointer's appearance
Of course you'd have to describe everything properly - e.g. which capabilities might be supported, how various structures (e.g. the "video mode information structure") are defined, how a frame of video is described to the driver (a list of commands that describe what to draw?, raw pixel data?), etc; and your native video driver interface (and mine) might be completely different to the example above.
Once you've done that you can implement a basic frame-buffer driver. For example, it could return a list of video modes that only has one video mode (the video mode that the boot code setup), and it might not support any optional capabilities/features, and anything it does support would be implemented in software (without hardware acceleration). Then, later on, you (or someone else) could implement video driver/s (based on your specification) that implement more of the optional capabilities and/or allow video mode switching and/or uses hardware acceleration. In the same way, software developers can write GUIs and/or libraries (e.g. OpenGL) and/or applications that rely on your specification, and this software can support things that are defined by the specification that aren't actually supported by any video driver (yet).
blm768 wrote:I just don't want to bother with it if it adds much effort; I'm hoping to get OpenGL drivers anyway (eventually...), so 2D acceleration likely wouldn't even be used much.
OpenGL is not a driver - OpenGL is an "Open Graphics Library" (a library that runs in user space). OpenGL may not have anything to do with the native video driver interface at all.
For example, the OpenGL library might create a "list of commands" in a buffer in RAM, and then send that list of commands to the native video driver (e.g. using a "draw a frame" native video driver function) when the application calls the "glFlush()" or "glFinish()" library function. In this case, the OpenGL specification doesn't describe the format of that "list of commands" being sent to the native video driver (it only describes the functions provided by a library).
Cheers,
Brendan