initial version of dlangui:d3d example

This commit is contained in:
Vadim Lopatin 2015-04-07 15:02:51 +03:00
parent 7beea4b5b9
commit d7133ae17b
10 changed files with 400 additions and 0 deletions

View File

@ -38,6 +38,11 @@ Project("{002A2DE9-8BB6-484D-9802-7E4AD4084715}") = "dmledit", "examples\dmledit
{5FF17402-9997-4D0E-8068-6D84B8769D98} = {5FF17402-9997-4D0E-8068-6D84B8769D98}
EndProjectSection
EndProject
Project("{002A2DE9-8BB6-484D-9802-7E4AD4084715}") = "d3d", "examples\d3d\d3d.visualdproj", "{55B79469-E5D8-4B58-89BD-5A3E11A696B0}"
ProjectSection(ProjectDependencies) = postProject
{5FF17402-9997-4D0E-8068-6D84B8769D98} = {5FF17402-9997-4D0E-8068-6D84B8769D98}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug COFF32|Any CPU = Debug COFF32|Any CPU
@ -390,6 +395,42 @@ Global
{06D73450-2919-48A8-B2C3-738B12505D74}.TestDebug|Win32.ActiveCfg = Debug|Win32
{06D73450-2919-48A8-B2C3-738B12505D74}.TestDebug|Win32.Build.0 = Debug|Win32
{06D73450-2919-48A8-B2C3-738B12505D74}.TestDebug|x64.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug COFF32|Any CPU.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug COFF32|Mixed Platforms.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug COFF32|Mixed Platforms.Build.0 = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug COFF32|Win32.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug COFF32|Win32.Build.0 = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug COFF32|x64.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug GDC|Any CPU.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug GDC|Mixed Platforms.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug GDC|Mixed Platforms.Build.0 = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug GDC|Win32.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug GDC|Win32.Build.0 = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug GDC|x64.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug LDC|Any CPU.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug LDC|Mixed Platforms.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug LDC|Mixed Platforms.Build.0 = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug LDC|Win32.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug LDC|Win32.Build.0 = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug LDC|x64.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug|Any CPU.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug|Win32.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug|Win32.Build.0 = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Debug|x64.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Release|Any CPU.ActiveCfg = Release|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Release|Mixed Platforms.Build.0 = Release|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Release|Win32.ActiveCfg = Release|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Release|Win32.Build.0 = Release|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.Release|x64.ActiveCfg = Release|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.TestDebug|Any CPU.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.TestDebug|Mixed Platforms.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.TestDebug|Mixed Platforms.Build.0 = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.TestDebug|Win32.ActiveCfg = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.TestDebug|Win32.Build.0 = Debug|Win32
{55B79469-E5D8-4B58-89BD-5A3E11A696B0}.TestDebug|x64.ActiveCfg = Debug|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -33,6 +33,7 @@
"./examples/helloworld/",
"./examples/example1/",
"./examples/dmledit/",
"./examples/d3d/",
"./examples/tetris/"
],
@ -63,6 +64,7 @@
"derelict-sdl2": "~>1.9.1",
"gl3n": "~>1.0.1"
}
"copyFiles-windows": ["lib/SDL2.dll"],
},
{
"name": "sfml",

View File

@ -0,0 +1,208 @@
<DProject>
<ProjectGuid>{55B79469-E5D8-4B58-89BD-5A3E11A696B0}</ProjectGuid>
<Config name="Debug" platform="Win32">
<obj>0</obj>
<link>0</link>
<lib>0</lib>
<subsystem>2</subsystem>
<multiobj>0</multiobj>
<singleFileCompilation>0</singleFileCompilation>
<oneobj>0</oneobj>
<mscoff>0</mscoff>
<trace>0</trace>
<quiet>0</quiet>
<verbose>0</verbose>
<vtls>0</vtls>
<vgc>0</vgc>
<symdebug>1</symdebug>
<optimize>0</optimize>
<cpu>0</cpu>
<isX86_64>0</isX86_64>
<isLinux>0</isLinux>
<isOSX>0</isOSX>
<isWindows>0</isWindows>
<isFreeBSD>0</isFreeBSD>
<isSolaris>0</isSolaris>
<scheduler>0</scheduler>
<useDeprecated>0</useDeprecated>
<errDeprecated>0</errDeprecated>
<useAssert>0</useAssert>
<useInvariants>0</useInvariants>
<useIn>0</useIn>
<useOut>0</useOut>
<useArrayBounds>0</useArrayBounds>
<noboundscheck>0</noboundscheck>
<useSwitchError>0</useSwitchError>
<useUnitTests>0</useUnitTests>
<useInline>0</useInline>
<release>0</release>
<preservePaths>0</preservePaths>
<warnings>0</warnings>
<infowarnings>0</infowarnings>
<checkProperty>0</checkProperty>
<genStackFrame>0</genStackFrame>
<pic>0</pic>
<cov>0</cov>
<nofloat>0</nofloat>
<Dversion>2.043</Dversion>
<ignoreUnsupportedPragmas>0</ignoreUnsupportedPragmas>
<allinst>0</allinst>
<stackStomp>0</stackStomp>
<compiler>0</compiler>
<otherDMD>0</otherDMD>
<cccmd>$(CC) -c</cccmd>
<ccTransOpt>1</ccTransOpt>
<program>$(DMDInstallDir)windows\bin\dmd.exe</program>
<imppath>$(SolutionDir)/src $(SolutionDir)/3rdparty $(SolutionDir)/3rdparty/libpng/source $(SolutionDir)/../DerelictGL3/source $(SolutionDir)/../DerelictUtil/source $(SolutionDir)/../DerelictFT/source $(SolutionDir)/../DerelictSDL2/source $(SolutionDir)/../de_image/source/interfaces $(SolutionDir)/../de_image/source/png $(SolutionDir)/../dlib</imppath>
<fileImppath>views views/res views/res/i18n views/res/mdpi</fileImppath>
<outdir>$(ConfigurationName)</outdir>
<objdir>$(OutDir)</objdir>
<objname />
<libname />
<doDocComments>0</doDocComments>
<docdir />
<docname />
<modules_ddoc />
<ddocfiles />
<doHdrGeneration>0</doHdrGeneration>
<hdrdir />
<hdrname />
<doXGeneration>1</doXGeneration>
<xfilename>$(IntDir)\$(TargetName).json</xfilename>
<debuglevel>0</debuglevel>
<debugids />
<versionlevel>0</versionlevel>
<versionids>Unicode USE_OPENGL USE_FREETYPE USE_SDL EmbedStandardResources</versionids>
<dump_source>0</dump_source>
<mapverbosity>0</mapverbosity>
<createImplib>0</createImplib>
<defaultlibname />
<debuglibname />
<moduleDepsFile />
<run>0</run>
<runargs />
<runCv2pdb>1</runCv2pdb>
<pathCv2pdb>$(VisualDInstallDir)cv2pdb\cv2pdb.exe</pathCv2pdb>
<cv2pdbPre2043>0</cv2pdbPre2043>
<cv2pdbNoDemangle>0</cv2pdbNoDemangle>
<cv2pdbEnumType>0</cv2pdbEnumType>
<cv2pdbOptions />
<objfiles />
<linkswitches />
<libfiles>ole32.lib kernel32.lib user32.lib comctl32.lib comdlg32.lib</libfiles>
<libpaths />
<deffile />
<resfile />
<exefile>$(OutDir)\$(ProjectName).exe</exefile>
<useStdLibPath>1</useStdLibPath>
<cRuntime>2</cRuntime>
<additionalOptions />
<preBuildCommand />
<postBuildCommand />
<filesToClean>*.obj;*.cmd;*.build;*.json;*.dep</filesToClean>
</Config>
<Config name="Release" platform="Win32">
<obj>0</obj>
<link>0</link>
<lib>0</lib>
<subsystem>2</subsystem>
<multiobj>0</multiobj>
<singleFileCompilation>0</singleFileCompilation>
<oneobj>0</oneobj>
<mscoff>0</mscoff>
<trace>0</trace>
<quiet>0</quiet>
<verbose>0</verbose>
<vtls>0</vtls>
<vgc>0</vgc>
<symdebug>0</symdebug>
<optimize>0</optimize>
<cpu>0</cpu>
<isX86_64>0</isX86_64>
<isLinux>0</isLinux>
<isOSX>0</isOSX>
<isWindows>0</isWindows>
<isFreeBSD>0</isFreeBSD>
<isSolaris>0</isSolaris>
<scheduler>0</scheduler>
<useDeprecated>0</useDeprecated>
<errDeprecated>0</errDeprecated>
<useAssert>0</useAssert>
<useInvariants>0</useInvariants>
<useIn>0</useIn>
<useOut>0</useOut>
<useArrayBounds>0</useArrayBounds>
<noboundscheck>0</noboundscheck>
<useSwitchError>0</useSwitchError>
<useUnitTests>0</useUnitTests>
<useInline>0</useInline>
<release>1</release>
<preservePaths>0</preservePaths>
<warnings>0</warnings>
<infowarnings>0</infowarnings>
<checkProperty>0</checkProperty>
<genStackFrame>0</genStackFrame>
<pic>0</pic>
<cov>0</cov>
<nofloat>0</nofloat>
<Dversion>2.043</Dversion>
<ignoreUnsupportedPragmas>0</ignoreUnsupportedPragmas>
<allinst>0</allinst>
<stackStomp>0</stackStomp>
<compiler>0</compiler>
<otherDMD>0</otherDMD>
<cccmd>$(CC) -c</cccmd>
<ccTransOpt>1</ccTransOpt>
<program>$(DMDInstallDir)windows\bin\dmd.exe</program>
<imppath />
<fileImppath />
<outdir>$(ConfigurationName)</outdir>
<objdir>$(OutDir)</objdir>
<objname />
<libname />
<doDocComments>0</doDocComments>
<docdir />
<docname />
<modules_ddoc />
<ddocfiles />
<doHdrGeneration>0</doHdrGeneration>
<hdrdir />
<hdrname />
<doXGeneration>1</doXGeneration>
<xfilename>$(IntDir)\$(TargetName).json</xfilename>
<debuglevel>0</debuglevel>
<debugids />
<versionlevel>0</versionlevel>
<versionids />
<dump_source>0</dump_source>
<mapverbosity>0</mapverbosity>
<createImplib>0</createImplib>
<defaultlibname />
<debuglibname />
<moduleDepsFile />
<run>0</run>
<runargs />
<runCv2pdb>0</runCv2pdb>
<pathCv2pdb>$(VisualDInstallDir)cv2pdb\cv2pdb.exe</pathCv2pdb>
<cv2pdbPre2043>0</cv2pdbPre2043>
<cv2pdbNoDemangle>0</cv2pdbNoDemangle>
<cv2pdbEnumType>0</cv2pdbEnumType>
<cv2pdbOptions />
<objfiles />
<linkswitches />
<libfiles>ole32.lib kernel32.lib user32.lib comctl32.lib comdlg32.lib</libfiles>
<libpaths />
<deffile />
<resfile />
<exefile>$(OutDir)\$(ProjectName).exe</exefile>
<useStdLibPath>1</useStdLibPath>
<cRuntime>1</cRuntime>
<additionalOptions />
<preBuildCommand />
<postBuildCommand />
<filesToClean>*.obj;*.cmd;*.build;*.json;*.dep</filesToClean>
</Config>
<Folder name="d3d">
<File path="src\d3d.d" />
</Folder>
</DProject>

17
examples/d3d/dub.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "d3d",
"description": "dlangui library example 3D Application",
"homepage": "https://github.com/buggins/dlangui",
"license": "Boost",
"authors": ["Vadim Lopatin"],
"stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi"],
"targetPath": "bin",
"targetName": "d3d",
"targetType": "executable",
"dependencies": {
"dlangui": "*",
}
}

54
examples/d3d/src/d3d.d Normal file
View File

@ -0,0 +1,54 @@
module d3d;
import dlangui;
mixin APP_ENTRY_POINT;
/// entry point for dlangui based application
extern (C) int UIAppMain(string[] args) {
// create window
Window window = Platform.instance.createWindow("DlangUI example - 3D Application", null);
// create some widget to show in window
//window.mainWidget = (new Button()).text("Hello, world!"d).margins(Rect(20,20,20,20));
window.mainWidget = parseML(q{
VerticalLayout {
margins: 10
padding: 10
backgroundColor: "#C0E0E070" // semitransparent yellow background
// red bold text with size = 150% of base style size and font face Arial
TextWidget { text: "Hello World example for DlangUI"; textColor: "red"; fontSize: 150%; fontWeight: 800; fontFace: "Arial" }
// arrange controls as form - table with two columns
TableLayout {
colCount: 2
TextWidget { text: "param 1" }
EditLine { id: edit1; text: "some text" }
TextWidget { text: "param 2" }
EditLine { id: edit2; text: "some text for param2" }
TextWidget { text: "some radio buttons" }
// arrange some radio buttons vertically
VerticalLayout {
RadioButton { id: rb1; text: "Item 1" }
RadioButton { id: rb2; text: "Item 2" }
RadioButton { id: rb3; text: "Item 3" }
}
TextWidget { text: "and checkboxes" }
// arrange some checkboxes horizontally
HorizontalLayout {
CheckBox { id: cb1; text: "checkbox 1" }
CheckBox { id: cb2; text: "checkbox 2" }
}
}
HorizontalLayout {
Button { id: btnOk; text: "Ok" }
Button { id: btnCancel; text: "Cancel" }
}
}
});
// show window
window.show();
// run message loop
return Platform.instance.enterMessageLoop();
}

View File

@ -0,0 +1,40 @@
EXIT=Exit
MENU_FILE=&File
MENU_FILE_NEW=&New
MENU_FILE_OPEN=&Open
MENU_FILE_OPEN_RECENT=Open recent
MENU_FILE_SAVE=&Save
MENU_FILE_EXIT=E&xit
MENU_EDIT=&Edit
MENU_EDIT_COPY=&Copy
MENU_EDIT_PASTE=&Paste
MENU_EDIT_CUT=Cu&t
MENU_EDIT_UNDO=&Undo
MENU_EDIT_REDO=&Redo
MENU_EDIT_INDENT=Indent block
MENU_EDIT_UNINDENT=Unindent block
MENU_EDIT_TOGGLE_LINE_COMMENT=Toggle line comment
MENU_EDIT_TOGGLE_BLOCK_COMMENT=Toggle block comment
MENU_EDIT_PREFERENCES=&Preferences
MENU_VIEW=&View
MENU_VIEW_LANGUAGE=Interface &Language
MENU_VIEW_LANGUAGE_EN=English
MENU_VIEW_LANGUAGE_RU=Русский
MENU_VIEW_THEME=&Theme
MENU_VIEW_THEME_DEFAULT=Default
MENU_VIEW_THEME_DARK=Dark
MENU_VIEW_THEME_CUSTOM1=Custom 1
MENU_WINDOW=&Window
MENU_WINDOW_PREFERENCES=&Preferences
MENU_HELP=&Help
MENU_HELP_VIEW_HELP=&View help
MENU_HELP_ABOUT=&About
MENU_DEBUG_UPDATE_PREVIEW=Update Preview
TAB_LONG_LIST=Long list
TAB_BUTTONS=Buttons
TAB_ANIMATION=Animation
TAB_TABLE_LAYOUT=Table layout
TAB_EDITORS=Editors
TAB_CANVAS=Canvas

View File

@ -0,0 +1,34 @@
EXIT=Выход
MENU_FILE=&Файл
MENU_FILE_OPEN=&Открыть
MENU_FILE_OPEN_RECENT=Открыть из последних
MENU_FILE_SAVE=&Сохранить
MENU_FILE_EXIT=Вы&ход
MENU_EDIT=&Правка
MENU_EDIT_COPY=&Копировать
MENU_EDIT_PASTE=&Вставить
MENU_EDIT_CUT=Вырезать
MENU_EDIT_UNDO=&Отмена
MENU_EDIT_REDO=&Повторить
MENU_EDIT_PREFERENCES=&Настройки
MENU_VIEW=&Вид
MENU_VIEW_LANGUAGE=&Язык интерфейса
MENU_VIEW_LANGUAGE_EN=English
MENU_VIEW_LANGUAGE_RU=Русский
MENU_VIEW_THEME=&Тема
MENU_VIEW_THEME_DEFAULT=Стандартная
MENU_VIEW_THEME_DARK=Тёмная
MENU_VIEW_THEME_CUSTOM1=Пример 1
MENU_WINDOW=&Окно
MENU_WINDOW_PREFERENCES=&Настройки
MENU_HELP=&Справка
MENU_HELP_VIEW_HELP=&Просмотр справки
MENU_HELP_ABOUT=&О программе
TAB_LONG_LIST=Длинный список
TAB_BUTTONS=Кнопки
TAB_ANIMATION=Анимация
TAB_TABLE_LAYOUT=Табличный layout
TAB_EDITORS=Редакторы

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -0,0 +1,4 @@
res/i18n/en.ini
res/i18n/ru.ini
res/mdpi/cr3_logo.png
res/mdpi/tx_fabric.jpg