Commit 41fa584f authored by David Llewellyn-Jones's avatar David Llewellyn-Jones

Improved UI with menus, new icons, various new buttons, working cancel...

Improved UI with menus, new icons, various new buttons, working cancel buttons, tooltips and general UI bugfixes.
parent a1fbf2f5
gladedir = $(datadir)/@PACKAGE@
glade_DATA = functy.ui cartesian.vs cartesian.fs cartesian-shadow.vs cartesian-shadow.fs spherical.vs spherical.fs spherical-shadow.vs spherical-shadow.fs curve.vs curve.fs curve-shadow.vs curve-shadow.fs screen.fs screen.vs depth.fs depth.vs
glade_DATA = functy.ui
EXTRA_DIST = $(glade_DATA)
SUBDIRS = icons shaders
This diff is collapsed.
gladedir = $(datadir)/@PACKAGE@/icons
glade_DATA = *.png
EXTRA_DIST = $(glade_DATA)
gladedir = $(datadir)/@PACKAGE@/shaders
glade_DATA = *.fs *.vs
EXTRA_DIST = $(glade_DATA)
......@@ -37,5 +37,7 @@ AC_CHECK_FUNCS([floor ftime pow sqrt])
AC_CONFIG_FILES([Makefile
src/Makefile
assets/Makefile])
assets/Makefile
assets/icons/Makefile
assets/shaders/Makefile])
AC_OUTPUT
......@@ -589,11 +589,11 @@ char * CartesianGenerateFragmentShaderShadow (FuncPersist * psFuncData) {
}
void CartesianInitShader (FuncPersist * psFuncData) {
LoadVertexShader (FUNCTYDIR "/cartesian.vs", psFuncData);
LoadFragmentShader (FUNCTYDIR "/cartesian.fs", psFuncData);
LoadVertexShader (FUNCTYDIR "/shaders/cartesian.vs", psFuncData);
LoadFragmentShader (FUNCTYDIR "/shaders/cartesian.fs", psFuncData);
LoadVertexShaderShadow (FUNCTYDIR "/cartesian-shadow.vs", psFuncData);
LoadFragmentShaderShadow (FUNCTYDIR "/cartesian-shadow.fs", psFuncData);
LoadVertexShaderShadow (FUNCTYDIR "/shaders/cartesian-shadow.vs", psFuncData);
LoadFragmentShaderShadow (FUNCTYDIR "/shaders/cartesian-shadow.fs", psFuncData);
FunctionShadersRegenerate (psFuncData);
}
......
......@@ -1125,11 +1125,11 @@ char * CurveGenerateFragmentShaderShadow (FuncPersist * psFuncData) {
}
void CurveInitShader (FuncPersist * psFuncData) {
LoadVertexShader (FUNCTYDIR "/curve.vs", psFuncData);
LoadFragmentShader (FUNCTYDIR "/curve.fs", psFuncData);
LoadVertexShader (FUNCTYDIR "/shaders/curve.vs", psFuncData);
LoadFragmentShader (FUNCTYDIR "/shaders/curve.fs", psFuncData);
LoadVertexShaderShadow (FUNCTYDIR "/curve-shadow.vs", psFuncData);
LoadFragmentShaderShadow (FUNCTYDIR "/curve-shadow.fs", psFuncData);
LoadVertexShaderShadow (FUNCTYDIR "/shaders/curve-shadow.vs", psFuncData);
LoadFragmentShaderShadow (FUNCTYDIR "/shaders/curve-shadow.fs", psFuncData);
FunctionShadersRegenerate (psFuncData);
}
......
......@@ -41,6 +41,7 @@ typedef enum {
FILESAVETAG_INVERT,
FILESAVETAG_WIREFRAME,
FILESAVETAG_FULLSCREEN,
FILESAVETAG_BUTTONBARSTYLE,
FILESAVETAG_EXPORTBINARY,
FILESAVETAG_EXPORTALPHA,
FILESAVETAG_EXPORTMULTIPLIER,
......@@ -195,6 +196,7 @@ bool SaveFile (char const * szFilename, bool boConfigure, FunctyPersist * psFunc
fprintf(fhFile, "\t\t<spin bool=\"%d\"/>\n", boValue);
boValue = GetFullScreen (psFunctyData->psVisData);
fprintf(fhFile, "\t\t<fullscreen bool=\"%d\"/>\n", boValue);
fprintf(fhFile, "\t\t<buttonbarstyle int=\"%d\"/>\n", psFunctyData->eButtonBarStyle);
GetView (& fRadius, & fRotation, & fElevation, psFunctyData->psVisData);
fprintf (fhFile, "\t\t<radius double=\"%f\"/>\n", fRadius);
......@@ -493,6 +495,9 @@ void StartElementFuncty (GMarkupParseContext * psContext, gchar const * szElemen
else if (strcmp (szElementName, "fullscreen") == 0) {
psFilesaveData->eTag[psFilesaveData->nLevel] = FILESAVETAG_FULLSCREEN;
}
else if (strcmp (szElementName, "buttonbarstyle") == 0) {
psFilesaveData->eTag[psFilesaveData->nLevel] = FILESAVETAG_BUTTONBARSTYLE;
}
else if (strcmp (szElementName, "useshaders") == 0) {
psFilesaveData->eTag[psFilesaveData->nLevel] = FILESAVETAG_USESHADERS;
}
......@@ -793,6 +798,11 @@ void StartElementSettings (FILESAVETAG eTag, gchar const * * aszAttributeNames,
SetExportFrames (nValue, psFilesaveData->psFunctyData);
}
break;
case FILESAVETAG_BUTTONBARSTYLE:
if (psFilesaveData->boConfigure) {
psFilesaveData->psFunctyData->eButtonBarStyle = ((BUTTONBARSTYLE)nValue);
}
break;
default:
// Do nothing
break;
......
This diff is collapsed.
......@@ -29,6 +29,16 @@
typedef struct _FunctyPersist FunctyPersist;
typedef enum _BUTTONBARSTYLE {
BUTTONBARSTYLE_INVALID = -1,
BUTTONBARSTYLE_NONE,
BUTTONBARSTYLE_ICONS,
BUTTONBARSTYLE_ICONSTEXT,
BUTTONBARSTYLE_NUM
} BUTTONBARSTYLE;
struct _FunctyPersist {
VisPersist * psVisData;
GtkWidget * psDrawingArea;
......@@ -57,7 +67,8 @@ struct _FunctyPersist {
GString * szFolder;
GString * szFolderAnim;
FUNCTYPE eNextFunctionType;
bool boButtonBarHidden;
//bool boButtonBarHidden;
BUTTONBARSTYLE eButtonBarStyle;
};
///////////////////////////////////////////////////////////////////
......
......@@ -775,11 +775,11 @@ char * SphericalGenerateFragmentShaderShadow (FuncPersist * psFuncData) {
}
void SphericalInitShader (FuncPersist * psFuncData) {
LoadVertexShader (FUNCTYDIR "/spherical.vs", psFuncData);
LoadFragmentShader (FUNCTYDIR "/spherical.fs", psFuncData);
LoadVertexShader (FUNCTYDIR "/shaders/spherical.vs", psFuncData);
LoadFragmentShader (FUNCTYDIR "/shaders/spherical.fs", psFuncData);
LoadVertexShaderShadow (FUNCTYDIR "/spherical-shadow.vs", psFuncData);
LoadFragmentShaderShadow (FUNCTYDIR "/spherical-shadow.fs", psFuncData);
LoadVertexShaderShadow (FUNCTYDIR "/shaders/spherical-shadow.vs", psFuncData);
LoadFragmentShaderShadow (FUNCTYDIR "/shaders/spherical-shadow.fs", psFuncData);
FunctionShadersRegenerate (psFuncData);
}
......
......@@ -748,8 +748,8 @@ void Init (VisPersist * psVisData) {
// Inititalise the shader
psVisData->psScreenShader = NewShaderPersist ();
szShaderVertexSource = LoadShaderFile (FUNCTYDIR "/screen.vs");
szShaderFragmentSource = LoadShaderFile (FUNCTYDIR "/screen.fs");
szShaderVertexSource = LoadShaderFile (FUNCTYDIR "/shaders/screen.vs");
szShaderFragmentSource = LoadShaderFile (FUNCTYDIR "/shaders/screen.fs");
// Generate the shaders
ShaderRegenerateVertex (szShaderVertexSource, psVisData->psScreenShader);
......@@ -761,8 +761,8 @@ void Init (VisPersist * psVisData) {
// Initialise the debug depth shader
psVisData->psDebugDepthShader = NewShaderPersist ();
szShaderVertexSource = LoadShaderFile (FUNCTYDIR "/depth.vs");
szShaderFragmentSource = LoadShaderFile (FUNCTYDIR "/depth.fs");
szShaderVertexSource = LoadShaderFile (FUNCTYDIR "/shaders/depth.vs");
szShaderFragmentSource = LoadShaderFile (FUNCTYDIR "/shaders/depth.fs");
// Generate the debug shaders
ShaderRegenerateVertex (szShaderVertexSource, psVisData->psDebugDepthShader);
......@@ -2072,7 +2072,7 @@ void Key (unsigned int key, int x, int y, unsigned int uKeyModifiers, VisPersist
ToggleShaders (psVisData);
break;
case ' ':
PauseAnimation ((!psVisData->boPaused), psVisData);
SetPauseAnimation ((!psVisData->boPaused), psVisData);
break;
case GDK_Up:
break;
......@@ -2495,10 +2495,14 @@ bool ExportModelFile (char const * szFilename, bool boBinary, bool boScreenCoord
return boSuccess;
}
void PauseAnimation (bool boPause, VisPersist * psVisData) {
void SetPauseAnimation (bool boPause, VisPersist * psVisData) {
psVisData->boPaused = boPause;
}
bool GetPauseAnimation (VisPersist * psVisData) {
return psVisData->boPaused;
}
/*
bool ExportModelFileAnimated (char const * szFilename, bool boBinary, bool boScreenCoords, bool boExportAlpha, float fMultiplier, double fTimeStart, double fTimeEnd, int nFrames, VisPersist * psVisData) {
bool boSuccess;
......
......@@ -108,7 +108,8 @@ void GetView (float * pfViewRadius, float * pfRotation, float * pfElevation, Vis
void ScaleFunctionRange (double fScale, VisPersist * psVisData);
bool ExportModelFile (char const * szFilename, bool boBinary, bool boScreenCoords, bool boExportAlpha, double fMultiplier, double fScale, VisPersist * psVisData);
bool ExportModelFileAnimated (char const * szFilename, bool boBinary, bool boScreenCoords, bool boExportAlpha, double fMultiplier, double fScale, double fTimeStart, double fTimeEnd, int nFrames, VisPersist * psVisData);
void PauseAnimation (bool boPause, VisPersist * psVisData);
void SetPauseAnimation (bool boPause, VisPersist * psVisData);
bool GetPauseAnimation (VisPersist * psVisData);
ControlvarPersist * SetControlVar (char const * const szVarName, char const * const szVarValue, VisPersist * psVisData);
FnControlPersist * GetControlVarList (VisPersist * psVisData);
void AssignControlVarsToFunctionList (VisPersist * psVisData);
......
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