00001 00002 00003 00004 #ifndef GOSU_GRAPHICS_HPP 00005 #define GOSU_GRAPHICS_HPP 00006 00007 #include <Gosu/Fwd.hpp> 00008 #include <Gosu/Color.hpp> 00009 #include <Gosu/GraphicsBase.hpp> 00010 #include <boost/scoped_ptr.hpp> 00011 #include <memory> 00012 00013 namespace Gosu 00014 { 00016 unsigned screenWidth(); 00017 00019 unsigned screenHeight(); 00020 00021 // Returns the maximum size of an image that can fit on a single 00022 // texture. 00023 // Only useful when extending Gosu using OpenGL. 00024 // (Held back until it will not cause a stock Ubuntu to crash. Don't ask me!) 00025 //extern unsigned const MAX_TEXTURE_SIZE; 00026 00030 class Graphics 00031 { 00032 struct Impl; 00033 boost::scoped_ptr<Impl> pimpl; 00034 00035 public: 00036 Graphics(unsigned physicalWidth, unsigned physicalHeight, bool fullscreen); 00037 ~Graphics(); 00038 00039 // Undocumented until I have thought about this... 00040 double factorX() const; 00041 double factorY() const; 00042 void setResolution(unsigned virtualWidth, unsigned virtualHeight); 00043 // End of Undocumented 00044 00045 unsigned width() const; 00046 unsigned height() const; 00047 bool fullscreen() const; 00048 00051 bool begin(Color clearWithColor = Color::BLACK); 00053 void end(); 00056 void beginGL(); 00058 void endGL(); 00060 void beginClipping(int x, int y, unsigned width, unsigned height); 00062 void endClipping(); 00063 00065 void beginRecording(); 00068 std::auto_ptr<Gosu::ImageData> endRecording(); 00069 00071 void drawLine(double x1, double y1, Color c1, 00072 double x2, double y2, Color c2, 00073 ZPos z, AlphaMode mode = amDefault); 00074 00075 void drawTriangle(double x1, double y1, Color c1, 00076 double x2, double y2, Color c2, 00077 double x3, double y3, Color c3, 00078 ZPos z, AlphaMode mode = amDefault); 00079 00080 void drawQuad(double x1, double y1, Color c1, 00081 double x2, double y2, Color c2, 00082 double x3, double y3, Color c3, 00083 double x4, double y4, Color c4, 00084 ZPos z, AlphaMode mode = amDefault); 00085 00088 std::auto_ptr<ImageData> createImage(const Bitmap& src, 00089 unsigned srcX, unsigned srcY, unsigned srcWidth, unsigned srcHeight, 00090 unsigned borderFlags); 00091 }; 00092 } 00093 00094 #endif
Documentation not clear enough? Please go to one of the places listed on http://www.libgosu.org/ and leave feedback. Thanks!