Qt
This commit is contained in:
@@ -60,5 +60,4 @@ struct _QERCameraTable
|
||||
|
||||
PFN_GETCAMERA m_pfnGetCamera;
|
||||
PFN_SETCAMERA m_pfnSetCamera;
|
||||
PFN_GETCAMWINDOWEXTENTS m_pfnGetCamWindowExtents;
|
||||
};
|
||||
|
||||
2860
include/igl.h
2860
include/igl.h
File diff suppressed because it is too large
Load Diff
@@ -23,18 +23,8 @@
|
||||
|
||||
#include "generic/constant.h"
|
||||
|
||||
typedef struct _GtkWidget GtkWidget;
|
||||
typedef int gint;
|
||||
typedef gint gboolean;
|
||||
|
||||
struct _QERGtkGLTable
|
||||
{
|
||||
INTEGER_CONSTANT( Version, 1 );
|
||||
STRING_CONSTANT( Name, "gtkgl" );
|
||||
|
||||
GtkWidget* ( *glwidget_new )(gboolean zbufffer);
|
||||
void ( *glwidget_swap_buffers )( GtkWidget* widget );
|
||||
gboolean ( *glwidget_make_current )( GtkWidget* widget );
|
||||
void ( *glwidget_destroy_context )( GtkWidget* widget );
|
||||
void ( *glwidget_create_context )( GtkWidget* widget );
|
||||
};
|
||||
|
||||
@@ -29,31 +29,29 @@
|
||||
// Rendering states to sort by.
|
||||
// Higher bits have the most effect - slowest state changes should be highest.
|
||||
|
||||
const unsigned int RENDER_DEFAULT = 0;
|
||||
const unsigned int RENDER_LINESTIPPLE = 1 << 0; // glEnable(GL_LINE_STIPPLE)
|
||||
const unsigned int RENDER_LINESMOOTH = 1 << 1; // glEnable(GL_LINE_SMOOTH)
|
||||
const unsigned int RENDER_POLYGONSTIPPLE = 1 << 2; // glEnable(GL_POLYGON_STIPPLE)
|
||||
const unsigned int RENDER_POLYGONSMOOTH = 1 << 3; // glEnable(GL_POLYGON_SMOOTH)
|
||||
const unsigned int RENDER_ALPHATEST = 1 << 4; // glEnable(GL_ALPHA_TEST)
|
||||
const unsigned int RENDER_DEPTHTEST = 1 << 5; // glEnable(GL_DEPTH_TEST)
|
||||
const unsigned int RENDER_DEPTHWRITE = 1 << 6; // glDepthMask(GL_TRUE)
|
||||
const unsigned int RENDER_COLOURWRITE = 1 << 7; // glColorMask(GL_TRUE; GL_TRUE; GL_TRUE; GL_TRUE)
|
||||
const unsigned int RENDER_CULLFACE = 1 << 8; // glEnable(GL_CULL_FACE)
|
||||
const unsigned int RENDER_SCALED = 1 << 9; // glEnable(GL_NORMALIZE)
|
||||
const unsigned int RENDER_SMOOTH = 1 << 10; // glShadeModel
|
||||
const unsigned int RENDER_FOG = 1 << 11; // glEnable(GL_FOG)
|
||||
const unsigned int RENDER_LIGHTING = 1 << 12; // glEnable(GL_LIGHTING)
|
||||
const unsigned int RENDER_BLEND = 1 << 13; // glEnable(GL_BLEND)
|
||||
const unsigned int RENDER_OFFSETLINE = 1 << 14; // glEnable(GL_POLYGON_OFFSET_LINE)
|
||||
const unsigned int RENDER_FILL = 1 << 15; // glPolygonMode
|
||||
const unsigned int RENDER_COLOURARRAY = 1 << 16; // glEnableClientState(GL_COLOR_ARRAY)
|
||||
const unsigned int RENDER_COLOURCHANGE = 1 << 17; // render() is allowed to call glColor*()
|
||||
const unsigned int RENDER_TEXTURE = 1 << 18; // glEnable(GL_TEXTURE_2D)
|
||||
const unsigned int RENDER_BUMP = 1 << 19;
|
||||
const unsigned int RENDER_PROGRAM = 1 << 20;
|
||||
const unsigned int RENDER_SCREEN = 1 << 21;
|
||||
const unsigned int RENDER_TEXT = 1 << 22; // override: globalstate |= RENDER_TEXTURE | RENDER_BLEND | RENDER_FILL
|
||||
const unsigned int RENDER_OVERRIDE = 1 << 23; // override: globalstate |= RENDER_FILL
|
||||
const unsigned int RENDER_DEFAULT = 0;
|
||||
const unsigned int RENDER_LINESTIPPLE = 1 << 0; // glEnable(GL_LINE_STIPPLE)
|
||||
const unsigned int RENDER_POLYGONSTIPPLE = 1 << 1; // glEnable(GL_POLYGON_STIPPLE)
|
||||
const unsigned int RENDER_ALPHATEST = 1 << 2; // glEnable(GL_ALPHA_TEST)
|
||||
const unsigned int RENDER_DEPTHTEST = 1 << 3; // glEnable(GL_DEPTH_TEST)
|
||||
const unsigned int RENDER_DEPTHWRITE = 1 << 4; // glDepthMask(GL_TRUE)
|
||||
const unsigned int RENDER_COLOURWRITE = 1 << 5; // glColorMask(GL_TRUE; GL_TRUE; GL_TRUE; GL_TRUE)
|
||||
const unsigned int RENDER_CULLFACE = 1 << 6; // glEnable(GL_CULL_FACE)
|
||||
const unsigned int RENDER_SCALED = 1 << 7; // glEnable(GL_NORMALIZE)
|
||||
const unsigned int RENDER_SMOOTH = 1 << 8; // glShadeModel
|
||||
const unsigned int RENDER_FOG = 1 << 9; // glEnable(GL_FOG)
|
||||
const unsigned int RENDER_LIGHTING = 1 << 10; // glEnable(GL_LIGHTING)
|
||||
const unsigned int RENDER_BLEND = 1 << 11; // glEnable(GL_BLEND)
|
||||
const unsigned int RENDER_OFFSETLINE = 1 << 12; // glEnable(GL_POLYGON_OFFSET_LINE)
|
||||
const unsigned int RENDER_FILL = 1 << 13; // glPolygonMode
|
||||
const unsigned int RENDER_COLOURARRAY = 1 << 14; // glEnableClientState(GL_COLOR_ARRAY)
|
||||
const unsigned int RENDER_COLOURCHANGE = 1 << 15; // render() is allowed to call glColor*()
|
||||
const unsigned int RENDER_TEXTURE = 1 << 16; // glEnable(GL_TEXTURE_2D)
|
||||
const unsigned int RENDER_BUMP = 1 << 17;
|
||||
const unsigned int RENDER_PROGRAM = 1 << 18;
|
||||
const unsigned int RENDER_SCREEN = 1 << 19;
|
||||
const unsigned int RENDER_TEXT = 1 << 20; // override: globalstate |= RENDER_TEXTURE | RENDER_BLEND | RENDER_FILL
|
||||
const unsigned int RENDER_OVERRIDE = 1 << 21; // override: globalstate |= RENDER_FILL
|
||||
typedef unsigned int RenderStateFlags;
|
||||
|
||||
|
||||
@@ -138,9 +136,6 @@ public:
|
||||
virtual void realise() = 0;
|
||||
virtual void unrealise() = 0;
|
||||
|
||||
virtual bool lightingSupported() const = 0;
|
||||
virtual bool useShaderLanguage() const = 0;
|
||||
|
||||
virtual const LightList& attach( LightCullable& cullable ) = 0;
|
||||
virtual void detach( LightCullable& cullable ) = 0;
|
||||
virtual void changed( LightCullable& cullable ) = 0;
|
||||
|
||||
@@ -34,58 +34,47 @@
|
||||
// NOTE: parent can be 0 in all functions but it's best to set them
|
||||
|
||||
// this API does not depend on gtk+ or glib
|
||||
typedef struct _GtkWidget GtkWidget;
|
||||
class QWidget;
|
||||
class QString;
|
||||
|
||||
enum EMessageBoxType
|
||||
enum class EMessageBoxType
|
||||
{
|
||||
eMB_OK,
|
||||
eMB_OKCANCEL,
|
||||
eMB_YESNO,
|
||||
eMB_YESNOCANCEL,
|
||||
eMB_NOYES,
|
||||
};
|
||||
|
||||
enum EMessageBoxIcon
|
||||
{
|
||||
eMB_ICONDEFAULT,
|
||||
eMB_ICONERROR,
|
||||
eMB_ICONWARNING,
|
||||
eMB_ICONQUESTION,
|
||||
eMB_ICONASTERISK,
|
||||
Info,
|
||||
Question, /* eIDYES | eIDNO */
|
||||
Warning,
|
||||
Error,
|
||||
};
|
||||
|
||||
enum EMessageBoxReturn
|
||||
{
|
||||
eIDOK,
|
||||
eIDCANCEL,
|
||||
eIDYES,
|
||||
eIDNO,
|
||||
eIDOK = 1,
|
||||
eIDCANCEL = 2,
|
||||
eIDYES = 4,
|
||||
eIDNO = 8,
|
||||
};
|
||||
|
||||
// simple Message Box, see above for the 'type' flags
|
||||
|
||||
typedef EMessageBoxReturn ( *PFN_QERAPP_MESSAGEBOX )( GtkWidget *parent, const char* text, const char* caption /* = "NetRadiant"*/, EMessageBoxType type /* = eMB_OK*/, EMessageBoxIcon icon /* = eMB_ICONDEFAULT*/ );
|
||||
//! \p buttons is combination of \enum EMessageBoxReturn flags or 0 for buttons, respecting \enum class EMessageBoxType
|
||||
typedef EMessageBoxReturn ( *PFN_QERAPP_MESSAGEBOX )( QWidget *parent, const char* text, const char* caption /* = "NetRadiant"*/, EMessageBoxType type /* = Info*/, int buttons /* = 0*/ );
|
||||
|
||||
// file and directory selection functions return null if the user hits cancel
|
||||
// - 'title' is the dialog title (can be null)
|
||||
// - 'path' is used to set the initial directory (can be null)
|
||||
// - 'pattern': the first pattern is for the win32 mode, then comes the Gtk pattern list, see Radiant source for samples
|
||||
typedef const char* ( *PFN_QERAPP_FILEDIALOG )( GtkWidget *parent, bool open, const char* title, const char* path /* = 0*/, const char* pattern /* = 0*/, bool want_load /* = false*/, bool want_import /* = false*/, bool want_save /* = false*/ );
|
||||
|
||||
// returns a gchar* string that must be g_free'd by the user
|
||||
typedef char* ( *PFN_QERAPP_DIRDIALOG )( GtkWidget *parent, const char* title /* = "Choose Directory"*/, const char* path /* = 0*/ );
|
||||
typedef const char* ( *PFN_QERAPP_FILEDIALOG )( QWidget *parent, bool open, const char* title, const char* path /* = 0*/, const char* pattern /* = 0*/, bool want_load /* = false*/, bool want_import /* = false*/, bool want_save /* = false*/ );
|
||||
|
||||
typedef QString ( *PFN_QERAPP_DIRDIALOG )( QWidget *parent, const QString& path /* = {} */ );
|
||||
// return true if the user closed the dialog with 'Ok'
|
||||
// 'color' is used to set the initial value and store the selected value
|
||||
template<typename Element> class BasicVector3;
|
||||
typedef BasicVector3<float> Vector3;
|
||||
typedef bool ( *PFN_QERAPP_COLORDIALOG )( GtkWidget *parent, Vector3& color,
|
||||
typedef bool ( *PFN_QERAPP_COLORDIALOG )( QWidget *parent, Vector3& color,
|
||||
const char* title /* = "Choose Color"*/ );
|
||||
|
||||
// load a .bmp file and create a GtkImage widget from it
|
||||
// load an image file and create QIcon from it
|
||||
// NOTE: 'filename' is relative to <radiant_path>/plugins/bitmaps/
|
||||
typedef struct _GtkImage GtkImage;
|
||||
typedef GtkImage* ( *PFN_QERAPP_NEWIMAGE )( const char* filename );
|
||||
class QIcon;
|
||||
typedef QIcon ( *PFN_QERAPP_NEWICON )( const char* filename );
|
||||
|
||||
// ========================================
|
||||
|
||||
@@ -156,12 +145,12 @@ struct _QERFuncTable_1
|
||||
|
||||
const char* ( *TextureBrowser_getSelectedShader )( );
|
||||
|
||||
// GTK+ functions
|
||||
// Qt functions
|
||||
PFN_QERAPP_MESSAGEBOX m_pfnMessageBox;
|
||||
PFN_QERAPP_FILEDIALOG m_pfnFileDialog;
|
||||
PFN_QERAPP_DIRDIALOG m_pfnDirDialog;
|
||||
PFN_QERAPP_COLORDIALOG m_pfnColorDialog;
|
||||
PFN_QERAPP_NEWIMAGE m_pfnNewImage;
|
||||
PFN_QERAPP_NEWICON m_pfnNewIcon;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
Copyright (C) 2001-2006, William Joseph.
|
||||
All Rights Reserved.
|
||||
|
||||
This file is part of GtkRadiant.
|
||||
|
||||
GtkRadiant is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
GtkRadiant is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GtkRadiant; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if _MSC_VER > 1000 && defined( WIN32 )
|
||||
#pragma warning(disable:4355) // 'this' : used in base member initializer list
|
||||
#pragma warning(disable:4503) // '[symbol]' : decorated name length exceeded, name was truncated
|
||||
#endif
|
||||
Reference in New Issue
Block a user