Graphics framework

This is where the graphics framework requirements & specification will come.



Current project members:

  • Valentin
  • Levente
  • Nathan



My current thoughts on the graphics framework is that the graphics driver is passed the basic hardware resources it needs. It cannot access any other hardware resources.




The driver needs to provide a list of supported video modes, resolutions and refresh rates. The driver might also provide infromation about the attached video display device. E.g. flat panel, resolution, make model refresh rate etc.




There needs to be a standard way to query the driver about the supported display modes. Either we have the display driver implementing an interface or have an abstract method on a base class.



  • public String getVideoCardManufacturer();
  • public String getVideoCardModel();
  • public int getAmountOfVideoMemory();
  • public DisplayMode[] getSupportedDisplayModes();
  • public DisplayMode getCurrentDisplayMode();
  • public void setDisplayMode(DisplayMode m) throws DisplayModeNotSupportedException;


The DisplayMode interface might have the following methods:


  • public boolean isTextMode();
  • public Dimension getResolution();
  • public int getRefreshRate();
  • public PixelFormat getPixelFormat();
  • public boolean has3DAcceleration();



The above interface begs the question whether there should be two sub-interfaces, TextDisplayMode and GraphicsDisplayMode. Should the graphics driver export the two lists separately? Most graphics cards enter a text display mode by default I think. Some export their own special text display modes.





Coments from Valentin:




My Opinion is that we should pack this informations that the driver can send back into an external class called GraphichDriverInfo and that we should have 2 other interfaces called TextDisplayMode and GraphicsDisplayMode that extend DisplayMode interface. So the list of classes/interfaces(and there methods) should look like this:



  • public interface GraphicDriver;
    • public GraphicDriverInfo getInfo();
  • public class GraphicDriverInfo;
    • public String getVideoCardManufacturer();
    • public String getVideoCardModel();
    • public int getAmountOfVideoMemory();
    • public DisplayMode[] getSupportedDisplayModes();
    • public DisplayMode getCurrentDisplayMode();
    • public void setDisplayMode(DisplayMode m) throws DisplayModeNotSupportedException;
  • public interface DisplayMode;
    • public Dimension getResolution();
    • public int getRefreshRate();
  • public interface TextDisplayMode extends DisplayMode;
    • public boolean isColorTextSupported();
  • public interface GraphicDisplayMode extends DisplayMode;
    • public PixelFormat getPixelFormat();
    • public boolean has3DAcceleration();



Everyone's input on this is wellcomed.