Commit f9d74ccb authored by Maciej Suminski's avatar Maciej Suminski

Removed shaderless OpenGL backend.

parent bd182aad
......@@ -55,7 +55,7 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
m_view = NULL;
m_painter = NULL;
SwitchBackend( aGalType, true );
SwitchBackend( aGalType );
SetBackgroundStyle( wxBG_STYLE_CUSTOM );
// Initial display settings
......@@ -149,13 +149,10 @@ void EDA_DRAW_PANEL_GAL::Refresh( bool eraseBackground, const wxRect* rect )
}
void EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType, bool aUseShaders )
void EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType )
{
wxLogDebug( wxT( "EDA_DRAW_PANEL_GAL::SwitchBackend: using shaders: %s" ),
aUseShaders ? "true" : "false" );
// Do not do anything if the currently used GAL is correct
if( aGalType == m_currentGal && aUseShaders == m_useShaders && m_gal != NULL )
if( aGalType == m_currentGal && m_gal != NULL )
return;
delete m_gal;
......@@ -163,7 +160,7 @@ void EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType, bool aUseShaders )
switch( aGalType )
{
case GAL_TYPE_OPENGL:
m_gal = new KiGfx::OPENGL_GAL( this, this, this, aUseShaders );
m_gal = new KiGfx::OPENGL_GAL( this, this, this );
break;
case GAL_TYPE_CAIRO:
......@@ -191,5 +188,4 @@ void EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType, bool aUseShaders )
m_gal->ResizeScreen( size.GetX(), size.GetY() );
m_currentGal = aGalType;
m_useShaders = aUseShaders;
}
This diff is collapsed.
......@@ -64,7 +64,7 @@ public:
* Switches method of rendering graphics.
* @param aGalType is a type of rendering engine that you want to use.
*/
void SwitchBackend( GalType aGalType, bool aUseShaders = false );
void SwitchBackend( GalType aGalType );
/**
* Function GetGAL
......@@ -89,8 +89,7 @@ protected:
///< using GAL
KiGfx::WX_VIEW_CONTROLS* m_viewControls; ///< Control for VIEW (moving, zooming, etc.)
GalType m_currentGal; ///< Currently used GAL
bool m_useShaders; ///< Are shaders used? (only for OpenGL GAL)
wxLongLong m_timeStamp;
wxLongLong m_timeStamp; ///< Timestamp for framelimiter
};
#endif
......@@ -82,14 +82,9 @@ public:
* a wxCommandEvent holding EVT_GAL_REDRAW, as sent by PostPaint().
*
* @param aName is the name of this window for use by wxWindow::FindWindowByName()
*
* @param isUseShaders is a flag, that indicates, if shaders should be used
* for higher quality rendering.
*
*/
OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener = NULL,
wxEvtHandler* aPaintListener = NULL, bool isUseShaders = false,
const wxString& aName = wxT( "GLCanvas" ) );
wxEvtHandler* aPaintListener = NULL, const wxString& aName = wxT( "GLCanvas" ) );
virtual ~OPENGL_GAL();
......@@ -366,7 +361,6 @@ private:
bool isGlewInitialized; ///< Is GLEW initialized?
bool isFramebufferInitialized; ///< Are the framebuffers initialized?
bool isShaderInitialized; ///< Was the shader initialized?
bool isUseShader; ///< Should the shaders be used?
bool isGrouping; ///< Was a group started?
/**
......
......@@ -85,9 +85,7 @@ static EDA_HOTKEY HkSwitchHighContrastMode( wxT("Switch Highcontrast mode"),
static EDA_HOTKEY HkCanvasDefault( wxT( "Switch to default canvas" ),
HK_CANVAS_DEFAULT, GR_KB_ALT + WXK_F9 );
static EDA_HOTKEY HkCanvasOpenGL( wxT( "Switch to OpenGL canvas" ),
HK_CANVAS_OPENGL, GR_KB_ALT + WXK_F10 );
static EDA_HOTKEY HkCanvasOpenGLShaders( wxT( "Switch to OpenGL canvas with shaders" ),
HK_CANVAS_OPENGL_SHADERS, GR_KB_ALT + WXK_F11 );
HK_CANVAS_OPENGL, GR_KB_ALT + WXK_F11 );
static EDA_HOTKEY HkCanvasCairo( wxT( "Switch to Cairo canvas" ),
HK_CANVAS_CAIRO, GR_KB_ALT + WXK_F12 );
......@@ -237,7 +235,7 @@ EDA_HOTKEY* board_edit_Hotkey_List[] =
&HkRecordMacros6, &HkCallMacros6, &HkRecordMacros7, &HkCallMacros7,
&HkRecordMacros8, &HkCallMacros8, &HkRecordMacros9, &HkCallMacros9,
&HkSwitchHighContrastMode,
&HkCanvasDefault, &HkCanvasCairo, &HkCanvasOpenGL, &HkCanvasOpenGLShaders,
&HkCanvasDefault, &HkCanvasCairo, &HkCanvasOpenGL,
NULL
};
......
......@@ -84,7 +84,6 @@ enum hotkey_id_commnand {
HK_SWITCH_HIGHCONTRAST_MODE,
HK_CANVAS_DEFAULT,
HK_CANVAS_OPENGL,
HK_CANVAS_OPENGL_SHADERS,
HK_CANVAS_CAIRO,
};
......
......@@ -364,13 +364,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
AddMenuItem( viewMenu, ID_MENU_CANVAS_OPENGL,
text, _( "Switch the canvas implementation to OpenGL" ),
KiBitmap( tools_xpm ) );
text = AddHotkeyName( _( "&Switch canvas to OpenGL (shaders)" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_CANVAS_OPENGL_SHADERS, IS_ACCELERATOR );
AddMenuItem( viewMenu, ID_MENU_CANVAS_OPENGL_SHADERS,
text, _( "Switch the canvas implementation to OpenGL that uses shaders" ),
KiBitmap( tools_xpm ) );
text = AddHotkeyName( _( "&Switch canvas to Cairo" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_CANVAS_CAIRO, IS_ACCELERATOR );
......
......@@ -163,7 +163,6 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_MENU_CANVAS_DEFAULT, PCB_EDIT_FRAME::SwitchCanvas )
EVT_MENU( ID_MENU_CANVAS_CAIRO, PCB_EDIT_FRAME::SwitchCanvas )
EVT_MENU( ID_MENU_CANVAS_OPENGL, PCB_EDIT_FRAME::SwitchCanvas )
EVT_MENU( ID_MENU_CANVAS_OPENGL_SHADERS, PCB_EDIT_FRAME::SwitchCanvas )
// Menu Get Design Rules Editor
EVT_MENU( ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG, PCB_EDIT_FRAME::ShowDesignRulesEditor )
......@@ -611,12 +610,7 @@ void PCB_EDIT_FRAME::SwitchCanvas( wxCommandEvent& aEvent )
break;
case ID_MENU_CANVAS_OPENGL:
m_galCanvas->SwitchBackend( EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL, false );
UseGalCanvas( true );
break;
case ID_MENU_CANVAS_OPENGL_SHADERS:
m_galCanvas->SwitchBackend( EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL, true );
m_galCanvas->SwitchBackend( EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL );
UseGalCanvas( true );
break;
}
......
......@@ -268,7 +268,6 @@ enum pcbnew_ids
ID_MENU_PCB_SHOW_3D_FRAME,
ID_MENU_CANVAS_DEFAULT,
ID_MENU_CANVAS_OPENGL,
ID_MENU_CANVAS_OPENGL_SHADERS,
ID_MENU_CANVAS_CAIRO,
ID_PCB_USER_GRID_SETUP,
ID_PCB_GEN_BOM_FILE_FROM_BOARD,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment