Skip to content

Commit

Permalink
Added a bare-bones example of a Doomsday plugin, as requested by ange…
Browse files Browse the repository at this point in the history
…liss.

All it does is output a message to the Doomsday console during startup.
  • Loading branch information
danij committed Oct 22, 2007
1 parent 319f12d commit 985e902
Show file tree
Hide file tree
Showing 7 changed files with 789 additions and 8 deletions.
1 change: 1 addition & 0 deletions doomsday/build/win32/dpexample_cl.rsp
@@ -0,0 +1 @@
./../../plugins/exampleplugin/src/example.c
25 changes: 17 additions & 8 deletions doomsday/build/win32/vcbuild.bat
Expand Up @@ -6,17 +6,17 @@ GOTO SetPaths
cls
ECHO $Id$
ECHO.
ECHO This build script compiles the Doomsday Engine and the associated
ECHO This build script compiles the Doomsday Engine and the associated
ECHO libraries.
ECHO.
ECHO Microsoft Visual C++ Toolkit is the minimum requirement. If you
ECHO want to compile the engine itself, you will also need the Platform
ECHO SDK, which can be downloaded from Microsoft's website. The DirectX
ECHO SDK is also required for compiling the engine. This means you can
ECHO compile everything using tools that can be downloaded for free, but
ECHO all the SDKs will add up to several hundred megabytes.
ECHO all the SDKs will add up to several hundred megabytes.
ECHO.
ECHO On the bright side, you only need the Visual C++ Toolkit in order to
ECHO On the bright side, you only need the Visual C++ Toolkit in order to
ECHO compile a game DLL. The game DLLs' only dependency is Doomsday.lib,
ECHO which is included in the Doomsday source code package.
ECHO.
Expand Down Expand Up @@ -74,7 +74,7 @@ SET INCS_LIBCURL=/I "./../../external/libcurl/portable/include"
SET INCS_PLUGIN_COMMON=/I "./../../plugins/common/include"
SET LIBS=/LIBPATH:"./Lib" /LIBPATH:"%DX_LIB%" /LIBPATH:"%EAX_LIB%" /LIBPATH:"%SDL_LIB%" /LIBPATH:"%SDLNET_LIB%" /LIBPATH:"%PLATFORM_LIB%" /LIBPATH:"./%BIN_DIR%"
SET FLAGS=/Ob1 /Oi /Ot /Oy /GF /FD /EHsc /MT /GS /Gy /Fo"./Obj/Release/" /Fd"./Obj/Release/" /W3 /Gd /Gs
SET LFLAGS=/INCREMENTAL:NO /SUBSYSTEM:WINDOWS /MACHINE:I386
SET LFLAGS=/INCREMENTAL:NO /SUBSYSTEM:WINDOWS /MACHINE:I386
SET EXTERNAL=./../../external


Expand Down Expand Up @@ -186,7 +186,7 @@ GOTO Failure
:dpMapLoad
ECHO Compiling dpMapLoad.dll ((gl)BSP Node Builder Plugin)...
md %OBJ_DIR%\dpMapLoad
cl /O2 /Ob1 %INCS_ZLIB% %INCS% /I "./../../external/glbsp/include" %DLLDEFINES% /D "GLBSP_PLUGIN" /D "DPMAPLOAD_EXPORTS" /GF /FD /EHsc /MT /Gy /Fo"./%OBJ_DIR%/dpMapLoad/" /Fd"./%OBJ_DIR%/dpMapLoad/" /W3 /Gd @dpmapload_cl.rsp /link /OUT:"./%BIN_DIR%/dpMapLoad.dll" %LFLAGS% /DLL /IMPLIB:"./%BIN_DIR%/dpMapLoad.lib" %LIBS% ./%BIN_DIR%/Doomsday.lib
cl /O2 /Ob1 %INCS_ZLIB% %INCS% /I "./../../external/glbsp/include" %DLLDEFINES% /D "GLBSP_PLUGIN" /D "DPMAPLOAD_EXPORTS" /GF /FD /EHsc /MT /Gy /Fo"./%OBJ_DIR%/dpMapLoad/" /Fd"./%OBJ_DIR%/dpMapLoad/" /W3 /Gd @dpmapload_cl.rsp /link /OUT:"./%BIN_DIR%/dpMapLoad.dll" %LFLAGS% /DLL /IMPLIB:"./%BIN_DIR%/dpMapLoad.lib" %LIBS% ./%BIN_DIR%/Doomsday.lib
IF %ERRORLEVEL% == 0 GOTO Done
GOTO Failure

Expand All @@ -204,7 +204,7 @@ GOTO Failure
:dsA3D
ECHO Compiling dsA3D.dll (A3D SoundFX driver) -- SKIPPING!
REM md %OBJ_DIR%\dsA3D
REM cl /O2 /Ob1 %INCS% /I "%A3D_INC%" %DLLDEFINES% /D "DSA3D_EXPORTS" /GF /FD /EHsc /MT /Gy /Fo"./%OBJ_DIR%/dsA3D" /Fd"./%OBJ_DIR%/dsA3D" /W3 /Gd @dsa3d_cl.rsp /link /OUT:"./%BIN_DIR%/dsA3D.dll" %LFLAGS% /DLL /DEF:"./../../plugins/a3d/api/dsA3D.def" /IMPLIB:"./%BIN_DIR%/dsA3D.lib" %LIBS% /LIBPATH:"%A3D_LIB%" ./%BIN_DIR%/doomsday.lib ia3dutil.lib ole32.lib
REM cl /O2 /Ob1 %INCS% /I "%A3D_INC%" %DLLDEFINES% /D "DSA3D_EXPORTS" /GF /FD /EHsc /MT /Gy /Fo"./%OBJ_DIR%/dsA3D" /Fd"./%OBJ_DIR%/dsA3D" /W3 /Gd @dsa3d_cl.rsp /link /OUT:"./%BIN_DIR%/dsA3D.dll" %LFLAGS% /DLL /DEF:"./../../plugins/a3d/api/dsA3D.def" /IMPLIB:"./%BIN_DIR%/dsA3D.lib" %LIBS% /LIBPATH:"%A3D_LIB%" ./%BIN_DIR%/doomsday.lib ia3dutil.lib ole32.lib
IF %ERRORLEVEL% == 0 GOTO Done
GOTO Failure

Expand All @@ -222,7 +222,7 @@ GOTO Failure
:dsCompat
ECHO Compiling dsCompat.dll (DirectSound(3D) SoundFX driver)...
md %OBJ_DIR%\dsCompat
cl /O2 /Ob1 %INCS% %DLLDEFINES% /D "DSCOMPAT_EXPORTS" /GF /FD /EHsc /MT /Gy /Fo"./%OBJ_DIR%/dsCompat" /Fd"./%OBJ_DIR%/dsCompat" /W3 /Gd @dscompat_cl.rsp /link /OUT:"./%BIN_DIR%/dsCompat.dll" %LFLAGS% /DLL /DEF:"./../../plugins/ds6/api/dsCompat.def" /IMPLIB:"./%BIN_DIR%/dsCompat.lib" %LIBS% eax.lib eaxguid.lib dsound.lib dxguid.lib ./%BIN_DIR%/doomsday.lib
cl /O2 /Ob1 %INCS% %DLLDEFINES% /D "DSCOMPAT_EXPORTS" /GF /FD /EHsc /MT /Gy /Fo"./%OBJ_DIR%/dsCompat" /Fd"./%OBJ_DIR%/dsCompat" /W3 /Gd @dscompat_cl.rsp /link /OUT:"./%BIN_DIR%/dsCompat.dll" %LFLAGS% /DLL /DEF:"./../../plugins/ds6/api/dsCompat.def" /IMPLIB:"./%BIN_DIR%/dsCompat.lib" %LIBS% eax.lib eaxguid.lib dsound.lib dxguid.lib ./%BIN_DIR%/doomsday.lib
IF %ERRORLEVEL% == 0 GOTO Done
GOTO Failure

Expand All @@ -249,7 +249,7 @@ GOTO Failure
:jHeretic
ECHO Compiling jHeretic.dll (jHeretic Game Library)...
md %OBJ_DIR%\jHeretic
cl /O2 /Ob1 %INCS_PLUGIN_COMMON% %INCS_ENGINE_API% %INCS_LZSS_PORTABLE% /I "./../../plugins/jheretic/include" /D "__JHERETIC__" %DLLDEFINES% /D "JHERETIC_EXPORTS" /GF /FD /EHsc /MT /Gy /Fo"./%OBJ_DIR%/jHeretic/" /Fd"./%OBJ_DIR%/jHeretic/" /W3 /Gd @jheretic_cl.rsp /link /OUT:"./%BIN_DIR%/jHeretic.dll" %LFLAGS% /LIBPATH:"./Lib" /DLL /DEF:"./../../plugins/jheretic/api/jheretic.def" /IMPLIB:"./%BIN_DIR%/jHeretic.lib" ./%BIN_DIR%/doomsday.lib %EXTERNAL%/lzss/win32/lzss.lib
cl /O2 /Ob1 %INCS_PLUGIN_COMMON% %INCS_ENGINE_API% %INCS_LZSS_PORTABLE% /I "./../../plugins/jheretic/include" /D "__JHERETIC__" %DLLDEFINES% /D "JHERETIC_EXPORTS" /GF /FD /EHsc /MT /Gy /Fo"./%OBJ_DIR%/jHeretic/" /Fd"./%OBJ_DIR%/jHeretic/" /W3 /Gd @jheretic_cl.rsp /link /OUT:"./%BIN_DIR%/jHeretic.dll" %LFLAGS% /LIBPATH:"./Lib" /DLL /DEF:"./../../plugins/jheretic/api/jheretic.def" /IMPLIB:"./%BIN_DIR%/jHeretic.lib" ./%BIN_DIR%/doomsday.lib %EXTERNAL%/lzss/win32/lzss.lib
IF %ERRORLEVEL% == 0 GOTO Done
GOTO Failure

Expand Down Expand Up @@ -281,6 +281,15 @@ IF %ERRORLEVEL% == 0 GOTO Done
GOTO Failure


:: *** dpExample.dll
:dpExample
ECHO Compiling dpExample.dll (Doomsday Example Plugin)...
md %OBJ_DIR%\dpExample
cl /O2 /Ob1 %DLLDEFINES% /D "EXAMPLE_PLUGIN" /D "DPEXAMPLE_EXPORTS" /GF /FD /EHsc /MT /Gy /Fo"./%OBJ_DIR%/dpExample/" /Fd"./%OBJ_DIR%/dpExample/" /W3 /Gd @dpexample_cl.rsp /link /OUT:"./%BIN_DIR%/dpExample.dll" %LFLAGS% /DLL /IMPLIB:"./%BIN_DIR%/dpExample.lib" %LIBS% ./%BIN_DIR%/Doomsday.lib
IF %ERRORLEVEL% == 0 GOTO Done
GOTO Failure


:: -- Move to the next argument.
:Done
SHIFT
Expand Down
232 changes: 232 additions & 0 deletions doomsday/build/win32/vs8/dpexample.vcproj
@@ -0,0 +1,232 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="dpExample"
ProjectGUID="{DC664B00-A393-4B3C-A847-C192E29D053E}"
RootNamespace="dpExample"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory="./Bin/Release"
IntermediateDirectory="./Obj/Release/dpExample"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\./Bin/Release/dpExample.tlb"
/>
<Tool
Name="VCCLCompilerTool"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\engine\api;"
PreprocessorDefinitions="EXAMPLE_PLUGIN;WIN32;NDEBUG;_WINDOWS;_USRDLL;DPEXAMPLE_EXPORTS"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\./Obj/Release/dpExample/dpExample.pch"
AssemblerListingLocation=".\./Obj/Release/dpExample/"
ObjectFile=".\./Obj/Release/dpExample/"
ProgramDataBaseFileName=".\./Obj/Release/dpExample/"
WarningLevel="3"
SuppressStartupBanner="true"
CallingConvention="0"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1035"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="./bin/release/Doomsday.lib"
OutputFile=".\./Bin/Release/dpExample.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\./Bin/Release/dpExample.pdb"
ImportLibrary=".\./Bin/Release/dpExample.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory="./Bin/Debug"
IntermediateDirectory="./Obj/Debug/dpExample"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC70.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName="./Bin/Debug/dpExample.tlb"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\engine\api;"
PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;EXAMPLE_PLUGIN;WIN32;_DEBUG;_WINDOWS;_USRDLL;DPEXAMPLE_EXPORTS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="./Obj/Debug/dpExample/dpExample.pch"
AssemblerListingLocation="./Obj/Debug/dpExample/"
ObjectFile="./Obj/Debug/dpExample/"
ProgramDataBaseFileName="./Obj/Debug/dpExample/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CallingConvention="0"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1035"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="./bin/debug/doomsday.lib"
OutputFile="./Bin/Debug/dpExample.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="./Bin/Debug/dpExample.pdb"
ImportLibrary="./Bin/Debug/dpExample.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\..\plugins\exampleplugin\src\example.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
37 changes: 37 additions & 0 deletions doomsday/plugins/exampleplugin/CMakeLists.txt
@@ -0,0 +1,37 @@
## deng build scripts.
## Copyright © 2006 - 2007 Jamie Jones <jamie_jones_au@yahoo.com.au>
## Copyright © 2007 Daniel Swanson <danij@dengine.net>
## This file is licensed under the GNU GPLv3 or any later versions,
##
## the deng build scripts 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 3 of the License, or
## (at your option) any later version.
##
## the deng build scripts 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 the deng build scripts; if not, write to the Free Software
## Foundation, Inc., 51 Franklin St, Fifth Floor,
## Boston, MA 02110-1301 USA
##
################################################################################
######################## Example Plugin #######################################

ADD_DEFINITIONS (-EXAMPLE_PLUGIN )

FILE(GLOB EXAMPLE_SOURCES src/*.c)

ADD_LIBRARY (dpexample SHARED ${EXAMPLE_SOURCES} )

IF (APPLE)
SET_TARGET_PROPERTIES (dpexample PROPERTIES COMPILE_FLAGS "${CMAKE_C_FLAGS} -bundle -bundle_loader doomsday")
ENDIF (APPLE)
################################################################################
######################## Install Targets ######################################
INSTALL(TARGETS dpexample
RUNTIME DESTINATION ${bindir}
LIBRARY DESTINATION ${libdir} )

0 comments on commit 985e902

Please sign in to comment.