This commit is contained in:
Timothee "TTimo" Besset 2013-07-06 16:03:25 -05:00
parent 5df79a9c62
commit 1c1fa7173a
4 changed files with 44 additions and 90 deletions

View file

@ -172,21 +172,6 @@ static gint timer( gpointer data ){
return TRUE; return TRUE;
} }
//! GtkGLExt port.
/*
static void create_context (GtkWidget *widget, gpointer data)
{
if (g_qeglobals_gui.d_glBase == NULL)
g_qeglobals_gui.d_glBase = widget;
}
static void destroy_context (GtkWidget *widget, gpointer data)
{
if (g_qeglobals_gui.d_glBase == widget)
g_qeglobals_gui.d_glBase = NULL;
}
*/
#if GTK_CHECK_VERSION( 1,3,0 ) #if GTK_CHECK_VERSION( 1,3,0 )
static gint scroll_event( GtkWidget *widget, static gint scroll_event( GtkWidget *widget,
GdkEventScroll *event, GdkEventScroll *event,
@ -216,12 +201,9 @@ GLWindow::GLWindow ( bool zbuffer ){
Sys_Printf( "GLWindow::GLWindow m_pWidget = %p\n", m_pWidget ); Sys_Printf( "GLWindow::GLWindow m_pWidget = %p\n", m_pWidget );
#endif #endif
//! GtkGLExt port.
//#if defined (__linux__) || defined (__APPLE__)
if ( g_qeglobals_gui.d_glBase == NULL ) { if ( g_qeglobals_gui.d_glBase == NULL ) {
g_qeglobals_gui.d_glBase = m_pWidget; g_qeglobals_gui.d_glBase = m_pWidget;
} }
//#endif
#if GTK_CHECK_VERSION( 1,3,0 ) #if GTK_CHECK_VERSION( 1,3,0 )
gtk_widget_set_events( m_pWidget, GDK_DESTROY | GDK_EXPOSURE_MASK | gtk_widget_set_events( m_pWidget, GDK_DESTROY | GDK_EXPOSURE_MASK |
@ -238,9 +220,6 @@ GLWindow::GLWindow ( bool zbuffer ){
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button_press_event", GTK_SIGNAL_FUNC( button_press ), this ); gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button_press_event", GTK_SIGNAL_FUNC( button_press ), this );
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button_release_event",GTK_SIGNAL_FUNC( button_release ), this ); gtk_signal_connect( GTK_OBJECT( m_pWidget ), "button_release_event",GTK_SIGNAL_FUNC( button_release ), this );
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "size_allocate", GTK_SIGNAL_FUNC( resize ), this ); gtk_signal_connect( GTK_OBJECT( m_pWidget ), "size_allocate", GTK_SIGNAL_FUNC( resize ), this );
//! GtkGLExt port.
// gtk_signal_connect (GTK_OBJECT (m_pWidget), "create_context", GTK_SIGNAL_FUNC (create_context), this);
// gtk_signal_connect (GTK_OBJECT (m_pWidget), "destroy_context", GTK_SIGNAL_FUNC (destroy_context), this);
#if GTK_CHECK_VERSION( 1,3,0 ) #if GTK_CHECK_VERSION( 1,3,0 )
gtk_signal_connect( GTK_OBJECT( m_pWidget ), "scroll_event", GTK_SIGNAL_FUNC( scroll_event ), this ); gtk_signal_connect( GTK_OBJECT( m_pWidget ), "scroll_event", GTK_SIGNAL_FUNC( scroll_event ), this );
#endif #endif

View file

@ -31,8 +31,7 @@
#ifndef _GLWINDOW_H_ #ifndef _GLWINDOW_H_
#define _GLWINDOW_H_ #define _GLWINDOW_H_
class GLWindow class GLWindow {
{
public: public:
GLWindow( bool zbuffer ); GLWindow( bool zbuffer );
virtual ~GLWindow (); virtual ~GLWindow ();
@ -41,8 +40,7 @@ bool MakeCurrent();
void SwapBuffers(); void SwapBuffers();
void SetTimer( guint millisec ); void SetTimer( guint millisec );
void KillTimer(); void KillTimer();
bool HasTimer() bool HasTimer() { return m_nTimer != 0; }
{ return m_nTimer != 0; }
void DestroyContext(); void DestroyContext();
void CreateContext(); void CreateContext();
@ -57,35 +55,21 @@ virtual void OnRButtonUp( guint32 flags, int pointx, int pointy ) { }
virtual void OnMButtonUp( guint32 flags, int pointx, int pointy ) { } virtual void OnMButtonUp( guint32 flags, int pointx, int pointy ) { }
virtual void OnMouseMove( guint32 flags, int pointx, int pointy ) { } virtual void OnMouseMove( guint32 flags, int pointx, int pointy ) { }
virtual void OnSize( int cx, int cy ) { } virtual void OnSize( int cx, int cy ) { }
virtual void OnTimer() { } virtual void OnTimer() { }
virtual void OnMouseWheel( bool bUp ) { } virtual void OnMouseWheel( bool bUp ) { }
void RedrawWindow(){ void RedrawWindow() { gtk_widget_queue_draw( m_pWidget ); }
gtk_widget_queue_draw( m_pWidget );
}
void SetFocus(){ void SetFocus() { /* gdk_window_raise (m_pWidget->window); */ }
/* gdk_window_raise (m_pWidget->window); */
}
void SetCapture(){ void SetCapture() { m_bMouseCapture = TRUE; }
m_bMouseCapture = TRUE; void ReleaseCapture() { m_bMouseCapture = FALSE; }
}
void ReleaseCapture(){ bool HasCapture() { return m_bMouseCapture; }
m_bMouseCapture = FALSE;
}
bool HasCapture(){ GtkWidget * GetWidget() { return m_pWidget; }
return m_bMouseCapture;
}
GtkWidget* GetWidget(){
return m_pWidget;
}
// member variables // member variables
public: public:

View file

@ -89,10 +89,8 @@ public:
GroupDlg(); GroupDlg();
void Create(); void Create();
void Show() void Show() { gtk_widget_show( m_pWidget ); }
{ gtk_widget_show( m_pWidget ); }; void Hide() { gtk_widget_hide( m_pWidget ); }
void Hide()
{ gtk_widget_hide( m_pWidget ); };
public: public:
GtkWidget* m_pNotebook; GtkWidget* m_pNotebook;

View file

@ -54,11 +54,6 @@ static unsigned tex_palette[256];
#define FONT_HEIGHT 10 #define FONT_HEIGHT 10
//int texture_mode = GL_NEAREST;
//int texture_mode = GL_NEAREST_MIPMAP_NEAREST;
//int texture_mode = GL_NEAREST_MIPMAP_LINEAR;
//int texture_mode = GL_LINEAR;
//int texture_mode = GL_LINEAR_MIPMAP_NEAREST;
int texture_mode = GL_LINEAR_MIPMAP_LINEAR; int texture_mode = GL_LINEAR_MIPMAP_LINEAR;
int g_nTextureOffset = 0; int g_nTextureOffset = 0;
@ -124,8 +119,7 @@ int GetTextureExtensionCount(){
// hardcoded hack for png support // hardcoded hack for png support
if ( g_pGameDescription->mGameFile == "sof2.game" ) { if ( g_pGameDescription->mGameFile == "sof2.game" ) {
return 3; return 3;
} } else {
else{
return 2; return 2;
} }
} }
@ -1667,8 +1661,7 @@ void TexWnd::OnCreate(){
if ( g_PrefsDlg.m_bTextureScrollbar ) { if ( g_PrefsDlg.m_bTextureScrollbar ) {
gtk_widget_show( g_qeglobals_gui.d_texture_scroll ); gtk_widget_show( g_qeglobals_gui.d_texture_scroll );
} } else {
else{
gtk_widget_hide( g_qeglobals_gui.d_texture_scroll ); gtk_widget_hide( g_qeglobals_gui.d_texture_scroll );
} }
m_bNeedRange = true; m_bNeedRange = true;