This is a method of the IDirectDraw Interface.
public void setDisplayMode(int w, int h, int bpp, int ref, int mode);