Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PoroCYon
Bonzomatic
Commits
60878646
Commit
60878646
authored
Jan 24, 2015
by
Gargaj
Browse files
start working on dx9 renderer
parent
14d78e2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Bonzomatic_W32_DX9.vcxproj
View file @
60878646
...
...
@@ -58,7 +58,7 @@
<Link>
<SubSystem>
Console
</SubSystem>
<GenerateDebugInformation>
true
</GenerateDebugInformation>
<AdditionalDependencies>
bass.lib;
sdl.lib;opengl32.lib;glu32
.lib;%(AdditionalDependencies)
</AdditionalDependencies>
<AdditionalDependencies>
bass.lib;
d3d9.lib;d3dx9
.lib;%(AdditionalDependencies)
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
...
...
@@ -77,11 +77,10 @@
<GenerateDebugInformation>
true
</GenerateDebugInformation>
<EnableCOMDATFolding>
true
</EnableCOMDATFolding>
<OptimizeReferences>
true
</OptimizeReferences>
<AdditionalDependencies>
bass.lib;
sdl.lib;opengl32.lib;glu32
.lib;%(AdditionalDependencies)
</AdditionalDependencies>
<AdditionalDependencies>
bass.lib;
d3d9.lib;d3dx9
.lib;%(AdditionalDependencies)
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile
Include=
"external\glee\GLee.c"
/>
<ClCompile
Include=
"external\jsonxx\jsonxx.cc"
/>
<ClCompile
Include=
"external\scintilla\lexers\LexA68k.cxx"
/>
<ClCompile
Include=
"external\scintilla\lexers\LexAbaqus.cxx"
/>
...
...
Bonzomatic_W32_DX9.vcxproj.filters
View file @
60878646
...
...
@@ -13,9 +13,6 @@
<Filter
Include=
"Externals\Scintilla\LexLib"
>
<UniqueIdentifier>
{7df248ba-a39f-453f-bc71-0b055987e525}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"Externals\GLee"
>
<UniqueIdentifier>
{213b61dc-5b70-4d50-8aa7-10b961aa6c04}
</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile
Include=
"external\scintilla\src\AutoComplete.cxx"
>
...
...
@@ -422,9 +419,6 @@
</ClCompile>
<ClCompile
Include=
"main.cpp"
/>
<ClCompile
Include=
"platform_w32_common\Clipboard.cpp"
/>
<ClCompile
Include=
"external\glee\GLee.c"
>
<Filter>
Externals\GLee
</Filter>
</ClCompile>
<ClCompile
Include=
"platform_w32_dx9\Renderer.cpp"
/>
<ClCompile
Include=
"platform_w32_common\FFT.cpp"
/>
<ClCompile
Include=
"external\stb_image.c"
>
...
...
platform_w32_dx9/Renderer.cpp
View file @
60878646
...
...
@@ -2,6 +2,7 @@
#include <windows.h>
#endif
#include <d3d9.h>
#include <d3dx9.h>
#include "../Renderer.h"
#define STBI_HEADER_FILE_ONLY
...
...
@@ -11,18 +12,24 @@
namespace
Renderer
{
char
defaultShader
[
65536
]
=
"float2 v2Resolution
\n
"
"texture1D texFFT;
\n
"
"texture2D texNoise;
\n
"
"texture2D texChecker;
\n
"
"texture2D texTex1;
\n
"
"texture2D texTex2;
\n
"
"
\n
"
"float4 ps_main( float2 TexCoord : TEXCOORD0 )
\n
"
"{
\n
"
" float2 uv = TexCoord;
\n
"
" uv -= 0.5;
\n
"
" uv /= float2(v2Resolution.y / v2Resolution.x, 1);
\n
"
"
\n
"
" float2 m;
\n
"
" m.x = atan(uv.x / uv.y) / 3.14;
\n
"
" m.y = 1 / length(uv) * .2;
\n
"
" float d = m.y;
\n
"
"
\n
"
" float f = tex
2
D( texFFT, d ).r * 100;
\n
"
" float f = tex
1
D( texFFT, d ).r * 100;
\n
"
" m.x += sin( fGlobalTime ) * 0.1;
\n
"
" m.y += fGlobalTime * 0.25;
\n
"
"
\n
"
...
...
@@ -32,10 +39,21 @@ namespace Renderer
bool
run
=
true
;
LPDIRECT3D9
pD3D
=
NULL
;
LPDIRECT3DDEVICE9
pDevice
=
NULL
;
int
nWidth
=
0
;
int
nHeight
=
0
;
bool
Open
(
RENDERER_SETTINGS
*
settings
)
{
// TODO: create window
pD3D
=
Direct3DCreate9
(
D3D9b_SDK_VERSION
);
if
(
!
pD3D
)
return
false
;
// TODO: create device
return
true
;
}
...
...
@@ -45,9 +63,13 @@ namespace Renderer
int
mouseEventBufferCount
=
0
;
void
StartFrame
()
{
pDevice
->
Clear
(
0
,
NULL
,
D3DCLEAR_TARGET
|
D3DCLEAR_ZBUFFER
,
0xFF808080
,
1.0
f
,
0
);
pDevice
->
BeginScene
();
}
void
EndFrame
()
{
pDevice
->
EndScene
();
pDevice
->
Present
(
NULL
,
NULL
,
NULL
,
NULL
);
}
bool
WantsToQuit
()
{
...
...
@@ -55,6 +77,8 @@ namespace Renderer
}
void
Close
()
{
if
(
pDevice
)
pDevice
->
Release
();
if
(
pD3D
)
pD3D
->
Release
();
}
void
RenderFullscreenQuad
()
...
...
@@ -76,6 +100,7 @@ namespace Renderer
struct
DX9Texture
:
public
Texture
{
LPDIRECT3DTEXTURE9
pTexture
;
};
int
textureUnit
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment