~ubuntu-branches/ubuntu/precise/flightgear/precise

« back to all changes in this revision

Viewing changes to src/Instrumentation/render_area_2d.hxx

  • Committer: Package Import Robot
  • Author(s): Ove Kaaven
  • Date: 2011-09-03 22:16:12 UTC
  • mfrom: (3.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20110903221612-2cjy0z7ztj5nkln5
Tags: 2.4.0-1
* New upstream release. Closes: #638588.
* Build-Depend on OpenSceneGraph 3.0, and the Subversion library.
* Recommend fgfs-scenery-base.
* Enable parallel builds (shorter compile times on multicore CPUs).
* Removed hack that tried to build without optimizations if
  building with optimizations fails.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
//
4
4
// Written by David Luff, started 2005.
5
5
//
6
 
// Copyright (C) 2005 - David C Luff - david.luff@nottingham.ac.uk
 
6
// Copyright (C) 2005 - David C Luff - daveluff AT ntlworld.com
7
7
//
8
8
// This program is free software; you can redistribute it and/or
9
9
// modify it under the terms of the GNU General Public License as
60
60
        RenderArea2D(int logx, int logy, int sizex, int sizey, int posx, int posy);
61
61
        ~RenderArea2D();
62
62
        
63
 
        void draw(osg::State& state);
64
 
        
65
63
        void SetPixelColor(const float* rgba);
66
64
        void SetBackgroundColor(const float* rgba);
67
65
        void SetPosition(int posx, int posy);
73
71
        // Set clip region to be the same as the rendered area (default)
74
72
        void ResetClipRegion();
75
73
        
76
 
        // Drawing specified in logical units
 
74
        // The DrawXXX functions place the shapes in the buffer, specified 
 
75
        // in logical units, and clipped to the current clip region.
 
76
        void DrawPixel(int x, int y, bool invert = false);
77
77
        void DrawLine(int x1, int y1, int x2, int y2);
78
78
        void DrawQuad(int x1, int y1, int x2, int y2, bool invert = false);
79
79
        void DrawBackground();
80
 
        // Draw a pixel specified by *logical* position
81
 
        void DrawPixel(int x, int y, bool invert = false);
82
 
        
83
 
        // The old drawing functions have been renamed in order to buffer the drawing for FG
84
 
        //
85
 
        // Drawing specified in logical units
86
 
        void oldDrawLine(int x1, int y1, int x2, int y2);
87
 
        void oldDrawQuad(int x1, int y1, int x2, int y2, bool invert = false);
88
 
        void oldDrawBackground();
89
 
        // Draw a pixel specified by *logical* position
90
 
        void oldDrawPixel(int x, int y, bool invert = false);
91
 
        
92
 
        // Flush the buffer pipeline
 
80
        
 
81
        // Call Draw to have the buffer contents drawn and then cleared.
 
82
        void Draw(osg::State& state);
 
83
        
 
84
        // Clear the buffer contents
93
85
        void Flush();
94
86
        
95
87
        // Turn debugging on or off.
104
96
        float _backgroundColor[4];
105
97
        float _pixelColor[4];
106
98
        
107
 
        // Actual drawing routines copied from Atlas
108
 
        void doSetColor( const float *rgb );
109
 
        void doDrawQuad( const SGVec2f *p);
110
 
        void doDrawQuad( const SGVec2f *p, const SGVec4f *color );
 
99
        // Drawing specified in logical units
 
100
        void DoDrawPixel(int x, int y, bool invert = false);
 
101
        void DoDrawLine(int x1, int y1, int x2, int y2);
 
102
        void DoDrawQuad(int x1, int y1, int x2, int y2, bool invert = false);
 
103
        void DoDrawBackground();
 
104
        
 
105
        // Actual rendering routines copied from Atlas
 
106
        void SetRenderColor( const float *rgb );
 
107
        void RenderQuad( const SGVec2f *p);
 
108
        void RenderQuad( const SGVec2f *p, const SGVec4f *color );
111
109
        
112
110
        vector<RA2DPrimitive> drawing_list;
113
111