FlightGear and OpenGL Core Profile: Difference between revisions

Jump to navigation Jump to search
Line 22: Line 22:
For starters, we can try the [[FlightGear Headless]] option to build a fgfs version without any graphics at all.
For starters, we can try the [[FlightGear Headless]] option to build a fgfs version without any graphics at all.


The next step will be identifying and excluding problematic sources (those containing legacy/raw OpenGL code, e.g. using <code>glBegin()</code> or <code>glEnable()</code> respectively) by adding <code>#ifdef</code> macros to the sources in question, and updating CMakeLists.txt accordingly, ideally in conjunction with a feature-specific build option to disable the corresponding feature (think [[PUI]] or the [[HUD]]).
The next step will be identifying and excluding problematic sources (those containing legacy/raw OpenGL code, e.g. using <code>glBegin()</code> or <code>glEnable()</code> respectively):
 
https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/src/Cockpit/render_area_2d.cxx
<syntaxhighlight lang="cpp">
void RenderArea2D::RenderQuad( const SGVec2f *p) {
    glBegin(GL_QUADS);
        glNormal3f(0.0f, 0.0f, 0.0f);
        glVertex2fv( p[0].data() );
        glVertex2fv( p[1].data() );
        glVertex2fv( p[2].data() );
        glVertex2fv( p[3].data() );
    glEnd();
}
</syntaxhighlight>
 
And then by adding <code>#ifdef</code> macros to the sources in question, and updating CMakeLists.txt accordingly: https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/src/Cockpit/panel_io.cxx#l751
 
Ideally, in conjunction with a feature-specific build option to disable the corresponding feature (think [[PUI]] or the [[HUD]]).


Initially, this will probably include:
Initially, this will probably include:

Navigation menu