X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Frender_area_2d.hxx;h=83d74efef7a1bdcd5ae2cda07dfd69db2e6b4cf9;hb=cd20c6073c8f4341d0f82070abae14b765cc8630;hp=44c5c0db2dbcc22c13b4270b5768984b82fafd5a;hpb=a6db6d89ff41a619569e6433409e8bf62ff98499;p=flightgear.git diff --git a/src/Instrumentation/render_area_2d.hxx b/src/Instrumentation/render_area_2d.hxx index 44c5c0db2..83d74efef 100644 --- a/src/Instrumentation/render_area_2d.hxx +++ b/src/Instrumentation/render_area_2d.hxx @@ -3,7 +3,7 @@ // // Written by David Luff, started 2005. // -// Copyright (C) 2005 - David C Luff - david.luff@nottingham.ac.uk +// Copyright (C) 2005 - David C Luff - daveluff AT ntlworld.com // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -32,8 +32,8 @@ #include #include -#include #include +#include #include @@ -60,8 +60,6 @@ public: RenderArea2D(int logx, int logy, int sizex, int sizey, int posx, int posy); ~RenderArea2D(); - void draw(osg::State& state); - void SetPixelColor(const float* rgba); void SetBackgroundColor(const float* rgba); void SetPosition(int posx, int posy); @@ -73,23 +71,17 @@ public: // Set clip region to be the same as the rendered area (default) void ResetClipRegion(); - // Drawing specified in logical units + // The DrawXXX functions place the shapes in the buffer, specified + // in logical units, and clipped to the current clip region. + void DrawPixel(int x, int y, bool invert = false); void DrawLine(int x1, int y1, int x2, int y2); void DrawQuad(int x1, int y1, int x2, int y2, bool invert = false); void DrawBackground(); - // Draw a pixel specified by *logical* position - void DrawPixel(int x, int y, bool invert = false); - // The old drawing functions have been renamed in order to buffer the drawing for FG - // - // Drawing specified in logical units - void oldDrawLine(int x1, int y1, int x2, int y2); - void oldDrawQuad(int x1, int y1, int x2, int y2, bool invert = false); - void oldDrawBackground(); - // Draw a pixel specified by *logical* position - void oldDrawPixel(int x, int y, bool invert = false); + // Call Draw to have the buffer contents drawn and then cleared. + void Draw(osg::State& state); - // Flush the buffer pipeline + // Clear the buffer contents void Flush(); // Turn debugging on or off. @@ -104,10 +96,16 @@ private: float _backgroundColor[4]; float _pixelColor[4]; - // Actual drawing routines copied from Atlas - void doSetColor( const float *rgb ); - void doDrawQuad( const sgVec2 *p, const sgVec3 *normals ); - void doDrawQuad( const sgVec2 *p, const sgVec3 *normals, const sgVec4 *color ); + // Drawing specified in logical units + void DoDrawPixel(int x, int y, bool invert = false); + void DoDrawLine(int x1, int y1, int x2, int y2); + void DoDrawQuad(int x1, int y1, int x2, int y2, bool invert = false); + void DoDrawBackground(); + + // Actual rendering routines copied from Atlas + void SetRenderColor( const float *rgb ); + void RenderQuad( const SGVec2f *p); + void RenderQuad( const SGVec2f *p, const SGVec4f *color ); vector drawing_list;