Renamed G3D-Fun to Blocks3D

This commit is contained in:
Vulpovile
2021-03-05 22:23:40 -08:00
parent 84521dd124
commit 2ba76bc9b7
7 changed files with 79 additions and 24 deletions

View File

@@ -1,24 +1,24 @@
# Microsoft Developer Studio Project File - Name="G3DTest" - Package Owner=<4> # Microsoft Developer Studio Project File - Name="Blocks3D" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00 # Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT ** # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101 # TARGTYPE "Win32 (x86) Application" 0x0101
CFG=G3DTest - Win32 Debug CFG=Blocks3D - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run !MESSAGE use the Export Makefile command and run
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "G3DTest.mak". !MESSAGE NMAKE /f "Blocks3D.mak".
!MESSAGE !MESSAGE
!MESSAGE You can specify a configuration when running NMAKE !MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "G3DTest.mak" CFG="G3DTest - Win32 Debug" !MESSAGE NMAKE /f "Blocks3D.mak" CFG="Blocks3D - Win32 Debug"
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "G3DTest - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "Blocks3D - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "G3DTest - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE "Blocks3D - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
@@ -29,7 +29,7 @@ CPP=cl.exe
MTL=midl.exe MTL=midl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "G3DTest - Win32 Release" !IF "$(CFG)" == "Blocks3D - Win32 Release"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0 # PROP BASE Use_Debug_Libraries 0
@@ -54,7 +54,7 @@ LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "G3DTest - Win32 Debug" !ELSEIF "$(CFG)" == "Blocks3D - Win32 Debug"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1 # PROP BASE Use_Debug_Libraries 1
@@ -83,8 +83,8 @@ LINK32=link.exe
# Begin Target # Begin Target
# Name "G3DTest - Win32 Release" # Name "Blocks3D - Win32 Release"
# Name "G3DTest - Win32 Debug" # Name "Blocks3D - Win32 Debug"
# Begin Group "Source Files" # Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"

View File

@@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
############################################################################### ###############################################################################
Project: "G3DTest"=.\G3DTest.dsp - Package Owner=<4> Project: "Blocks3D"=.\Blocks3D.dsp - Package Owner=<4>
Package=<5> Package=<5>
{{{ {{{

View File

@@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005 # Visual C++ Express 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "G3DTest", "G3DTest.vcproj", "{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Blocks3D", "Blocks3D.vcproj", "{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@@ -2,9 +2,9 @@
<VisualStudioProject <VisualStudioProject
ProjectType="Visual C++" ProjectType="Visual C++"
Version="8.00" Version="8.00"
Name="G3DTest" Name="Blocks3D"
ProjectGUID="{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}" ProjectGUID="{6C4D6EEF-B1D1-456A-B850-92CAB17124BE}"
RootNamespace="G3DTest" RootNamespace="Blocks3D"
> >
<Platforms> <Platforms>
<Platform <Platform
@@ -43,7 +43,7 @@
MkTypLibCompatible="true" MkTypLibCompatible="true"
SuppressStartupBanner="true" SuppressStartupBanner="true"
TargetEnvironment="1" TargetEnvironment="1"
TypeLibraryName=".\Release/G3DTest.tlb" TypeLibraryName=".\Release/Blocks3D.tlb"
HeaderFileName="" HeaderFileName=""
/> />
<Tool <Tool
@@ -55,7 +55,7 @@
StringPooling="true" StringPooling="true"
RuntimeLibrary="2" RuntimeLibrary="2"
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\Release/G3DTest.pch" PrecompiledHeaderFile=".\Release/Blocks3D.pch"
AssemblerListingLocation=".\Release/" AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/" ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/" ProgramDataBaseFileName=".\Release/"
@@ -76,10 +76,10 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="Advapi32.lib UxTheme.lib Comctl32.lib Comdlg32.lib Shell32.lib" AdditionalDependencies="Advapi32.lib UxTheme.lib Comctl32.lib Comdlg32.lib Shell32.lib"
OutputFile="./G3DTest.exe" OutputFile="./Blocks3D.exe"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="true" SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/G3DTest.pdb" ProgramDatabaseFile=".\Release/Blocks3D.pdb"
SubSystem="2" SubSystem="2"
TargetMachine="1" TargetMachine="1"
/> />
@@ -95,7 +95,7 @@
<Tool <Tool
Name="VCBscMakeTool" Name="VCBscMakeTool"
SuppressStartupBanner="true" SuppressStartupBanner="true"
OutputFile=".\Release/G3DTest.bsc" OutputFile=".\Release/Blocks3D.bsc"
/> />
<Tool <Tool
Name="VCFxCopTool" Name="VCFxCopTool"
@@ -139,7 +139,7 @@
MkTypLibCompatible="true" MkTypLibCompatible="true"
SuppressStartupBanner="true" SuppressStartupBanner="true"
TargetEnvironment="1" TargetEnvironment="1"
TypeLibraryName=".\Debug/G3DTest.tlb" TypeLibraryName=".\Debug/Blocks3D.tlb"
HeaderFileName="" HeaderFileName=""
/> />
<Tool <Tool
@@ -151,7 +151,7 @@
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
RuntimeLibrary="3" RuntimeLibrary="3"
EnableFunctionLevelLinking="false" EnableFunctionLevelLinking="false"
PrecompiledHeaderFile=".\Debug/G3DTest.pch" PrecompiledHeaderFile=".\Debug/Blocks3D.pch"
AssemblerListingLocation=".\Debug/" AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/" ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/" ProgramDataBaseFileName=".\Debug/"
@@ -173,11 +173,11 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="Advapi32.lib UxTheme.lib Comctl32.lib Comdlg32.lib Shell32.lib Urlmon.lib ole32.lib oleaut32.lib uuid.lib" AdditionalDependencies="Advapi32.lib UxTheme.lib Comctl32.lib Comdlg32.lib Shell32.lib Urlmon.lib ole32.lib oleaut32.lib uuid.lib"
OutputFile="./G3DTest-Debug.exe" OutputFile="./Blocks3D-Debug.exe"
LinkIncremental="2" LinkIncremental="2"
SuppressStartupBanner="true" SuppressStartupBanner="true"
GenerateDebugInformation="true" GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/G3DTest.pdb" ProgramDatabaseFile=".\Debug/Blocks3D.pdb"
SubSystem="1" SubSystem="1"
TargetMachine="1" TargetMachine="1"
/> />
@@ -193,7 +193,7 @@
<Tool <Tool
Name="VCBscMakeTool" Name="VCBscMakeTool"
SuppressStartupBanner="true" SuppressStartupBanner="true"
OutputFile=".\Debug/G3DTest.bsc" OutputFile=".\Debug/Blocks3D.bsc"
/> />
<Tool <Tool
Name="VCFxCopTool" Name="VCFxCopTool"

View File

@@ -136,6 +136,8 @@ GuiRootInstance::GuiRootInstance() : _message(""), _messageTime(0)
button->fontLocationRelativeTo = Vector2(10, 0); button->fontLocationRelativeTo = Vector2(10, 0);
button->setAllColorsSame(); button->setAllColorsSame();
button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F); button->boxColorOvr = Color4(0.6F,0.6F,0.6F,0.4F);
button->name = "file";
button->setButtonListener(new MenuButtonListener());
button = makeTextButton(); button = makeTextButton();
button->boxBegin = Vector2(125, 0); button->boxBegin = Vector2(125, 0);

View File

@@ -8,4 +8,36 @@ void MenuButtonListener::onButton1MouseClick(BaseButtonInstance* button)
g_dataModel->toggleRun(); g_dataModel->toggleRun();
((ToggleImageButtonInstance*)button)->checked = g_dataModel->isRunning(); ((ToggleImageButtonInstance*)button)->checked = g_dataModel->isRunning();
} }
else if(button->name == "file")
{
HMENU hPopupMenu = CreatePopupMenu();
HWND hwnd = CreateWindowEx(
WS_EX_APPWINDOW,
"MenuWindow",
"Main test",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
800,
660,
NULL, // parent
NULL, // menu
GetModuleHandle(NULL),
NULL
);
AppendMenu(hPopupMenu, MF_STRING, 0, "Test");
if(hPopupMenu == NULL)
{
MessageBox(NULL, "Menu is null!", "Failed", MB_OK);
}
else if(hwnd == NULL)
{
MessageBox(NULL, "HWND is null!", "Failed", MB_OK);
}
else if(!TrackPopupMenu(hPopupMenu, TPM_LEFTBUTTON, 100, 100, 0, hwnd, 0))
{
MessageBox(NULL, "Failed to track!", "Failed", MB_OK);
}
}
} }

View File

@@ -145,6 +145,25 @@ LRESULT CALLBACK G3DProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
} }
LRESULT CALLBACK MenuProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
Application *app = (Application *)GetWindowLongPtr(hwnd, GWL_USERDATA);
if (app==NULL)
{
return DefWindowProc(hwnd, msg, wParam, lParam);
}
switch(msg)
{
default:
{
return DefWindowProc(hwnd, msg, wParam, lParam);
}
}
return 0;
}
int main(int argc, char** argv) { int main(int argc, char** argv) {
try{ try{
hresult = OleInitialize(NULL); hresult = OleInitialize(NULL);
@@ -187,6 +206,8 @@ int main(int argc, char** argv) {
return false; return false;
if (!createWindowClass("G3DWindow",G3DProc,hThisInstance)) if (!createWindowClass("G3DWindow",G3DProc,hThisInstance))
return false; return false;
if (!createWindowClass("MenuWindow",MenuProc,hThisInstance))
return false;
HWND hwndMain = CreateWindowEx( HWND hwndMain = CreateWindowEx(
WS_EX_APPWINDOW, WS_EX_APPWINDOW,