• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

Graphics.hpp

Go to the documentation of this file.
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     
00024     class Graphics
00025     {
00026         struct Impl;
00027         boost::scoped_ptr<Impl> pimpl;
00028 
00029     public:
00030         Graphics(unsigned physicalWidth, unsigned physicalHeight, bool fullscreen);
00031         ~Graphics();
00032 
00033         // Undocumented until I have thought about this...
00034         double factorX() const;
00035         double factorY() const;
00036         void setResolution(unsigned virtualWidth, unsigned virtualHeight);
00037         // End of Undocumented
00038         
00039         unsigned width() const;
00040         unsigned height() const;
00041         bool fullscreen() const;
00042 
00045         bool begin(Color clearWithColor = Colors::black);
00047         void end();
00050         void beginGL();
00052         void endGL();
00054         void beginClipping(int x, int y, unsigned width, unsigned height);
00056         void endClipping();
00057 
00059         void drawLine(double x1, double y1, Color c1,
00060             double x2, double y2, Color c2,
00061             ZPos z, AlphaMode mode = amDefault);
00062 
00063         void drawTriangle(double x1, double y1, Color c1,
00064             double x2, double y2, Color c2,
00065             double x3, double y3, Color c3,
00066             ZPos z, AlphaMode mode = amDefault);
00067 
00068         void drawQuad(double x1, double y1, Color c1,
00069             double x2, double y2, Color c2,
00070             double x3, double y3, Color c3,
00071             double x4, double y4, Color c4,
00072             ZPos z, AlphaMode mode = amDefault);
00073 
00076         std::auto_ptr<ImageData> createImage(const Bitmap& src,
00077             unsigned srcX, unsigned srcY, unsigned srcWidth, unsigned srcHeight,
00078             unsigned borderFlags);
00079     };
00080 }
00081 
00082 #endif

Documentation not clear enough? Please go to one of the places listed on http://www.libgosu.org/ and leave feedback. Thanks!