Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

working dx11 premake4

  • Loading branch information...
commit fd0ab07b7c7afe6b677087edfa1f06d81aa6bad2 1 parent 13d1fb3
Nicholas Kostelnik authored December 22, 2012
BIN  assets/actors/floor/floor.mb
Binary file not shown
BIN  assets/actors/texturedcube/TexturedCube.mb
Binary file not shown
14  libs/json/reader.inl
@@ -48,7 +48,7 @@ public:
48 48
    char Get(); // big, define outside
49 49
    char Peek() {
50 50
       assert(m_iStr.eof() == false); // enforce reading of only valid stream data 
51  
-      return m_iStr.peek();
  51
+      return (char)m_iStr.peek();
52 52
    }
53 53
 
54 54
    bool EOS() {
@@ -58,6 +58,11 @@ public:
58 58
 
59 59
    const Location& GetLocation() const { return m_Location; }
60 60
 
  61
+   InputStream& operator= (const InputStream& other)
  62
+   {
  63
+     return *this;
  64
+   }
  65
+
61 66
 private:
62 67
    std::istream& m_iStr;
63 68
    Location m_Location;
@@ -67,7 +72,7 @@ private:
67 72
 inline char Reader::InputStream::Get()
68 73
 {
69 74
    assert(m_iStr.eof() == false); // enforce reading of only valid stream data 
70  
-   char c = m_iStr.get();
  75
+   char c = (char)m_iStr.get();
71 76
    
72 77
    ++m_Location.m_nDocOffset;
73 78
    if (c == '\n') {
@@ -96,6 +101,11 @@ public:
96 101
 
97 102
    bool EOS() const;
98 103
 
  104
+   TokenStream& operator= (const TokenStream& other)
  105
+   {
  106
+     return *this;
  107
+   }
  108
+
99 109
 private:
100 110
    const Tokens& m_Tokens;
101 111
    Tokens::const_iterator m_itCurrent;
14  old/add_pch.rb
... ...
@@ -0,0 +1,14 @@
  1
+cpp_files = Dir["**/*.cpp"]
  2
+
  3
+cpp_files.each do |cpp_file|
  4
+	f = File.open(cpp_file, "r+")
  5
+	lines = f.readlines
  6
+	f.close
  7
+
  8
+	lines = ["#include \"stdafx.h\"\n\n"] + lines
  9
+
  10
+	output = File.new(cpp_file, "w")
  11
+	lines.each { |line| output.write line }
  12
+	output.close
  13
+end
  14
+
11  premake4.lua
@@ -41,6 +41,15 @@
41 41
 		configuration "vs*"
42 42
 			defines     { "_CRT_SECURE_NO_WARNINGS" }
43 43
 			buildoptions "-wd4100"
  44
+			links {
  45
+				"d3dcompiler",
  46
+				"dxguid",
  47
+				"dinput8",
  48
+				"d3d9",
  49
+				"d3d11",
  50
+				"d3dx10",
  51
+				"d3dx11"
  52
+			}
44 53
 			includedirs { 
45 54
 				"src/engine/common/renderer",
46 55
 				"src/engine/platform/renderer/dx11",
@@ -60,7 +69,7 @@
60 69
 		configuration "macosx"
61 70
 			buildoptions "-stdlib=libc++"
62 71
 			linkoptions  "-stdlib=libc++"
63  
-			links       {
  72
+			links {
64 73
 				"AppKit.framework",
65 74
 				"Foundation.framework", 
66 75
 				"CoreServices.framework",
4  src/engine/common/dynamics/NavierStokesSimulation.cpp
@@ -46,8 +46,8 @@ void NavierStokesSimulation::diffuseDensity(float dt) {
46 46
 //	float a = dt * diffuseRate_ * gridSize_.width * gridSize_.height;
47 47
 
48 48
 	for (unsigned int solverIteration = 0; solverIteration < solverIterations_; solverIteration++) {
49  
-		for (unsigned int x = 1; x < gridSize_.width; x++) {
50  
-			for (unsigned int y = 1; y < gridSize_.height; y++) {
  49
+		for (unsigned int x = 1; x < (unsigned int)gridSize_.width; x++) {
  50
+			for (unsigned int y = 1; y < (unsigned int)gridSize_.height; y++) {
51 51
 
52 52
 			}
53 53
 		}
2  src/engine/platform/input/win/WindowsKeyboard.cpp
... ...
@@ -1,6 +1,6 @@
1 1
 #include "WindowsKeyboard.h"
2 2
 
3  
-#include "platform/WindowsUtils.h"
  3
+#include "WindowsUtils.h"
4 4
 
5 5
 bool WindowsKeyboard::keyState(char keyCode) {
6 6
   return WindowsUtils::getKeyState(keyCode);
2  src/engine/platform/input/win/WindowsMouse.cpp
... ...
@@ -1,6 +1,6 @@
1 1
 #include "WindowsMouse.h"
2 2
 
3  
-#include "platform/WindowsUtils.h"
  3
+#include "WindowsUtils.h"
4 4
 
5 5
 void WindowsMouse::setup() {
6 6
 
4  src/engine/platform/platform/win/WindowsUtils.cpp
@@ -81,7 +81,7 @@ bool WindowsUtils::pumpMessages() {
81 81
     }
82 82
 
83 83
     if (msg.message == WM_KEYDOWN) {
84  
-      char wParam = MapVirtualKey((UINT) msg.wParam, 2) & 0x0000FFFF;
  84
+      char wParam = (char)MapVirtualKey((UINT) msg.wParam, 2) & 0x0000FFFF;
85 85
       int keyStateIndex = (int)wParam;
86 86
       keyStates_[keyStateIndex] = true;
87 87
       if (wParam == 27) { // escape
@@ -90,7 +90,7 @@ bool WindowsUtils::pumpMessages() {
90 90
     }
91 91
 
92 92
     if (msg.message == WM_KEYUP) {
93  
-      unsigned char wParam = MapVirtualKey((UINT) msg.wParam, 2) & 0x0000FFFF;
  93
+      unsigned char wParam = (char)MapVirtualKey((UINT) msg.wParam, 2) & 0x0000FFFF;
94 94
       keyStates_[wParam] = false;
95 95
       if (keyboardListener_) {
96 96
         keyboardListener_->keyUp(wParam);
5  src/engine/platform/renderer/dx11/Direct3D11GraphicsInterface.cpp
@@ -7,7 +7,7 @@
7 7
 
8 8
 #include <comdef.h>
9 9
 
10  
-#include "platform/WindowsUtils.h"
  10
+#include "WindowsUtils.h"
11 11
 
12 12
 #include "io/dds.h"
13 13
 #include "io/DDSImage.h"
@@ -40,12 +40,9 @@ void Direct3D11GraphicsInterface::createGraphicsContext(HWND hWnd, int width, in
40 40
     swapChainDesc.SampleDesc.Count = multiSamples;                   // how many multisamples
41 41
     swapChainDesc.Windowed = TRUE;                                    // windowed/full-screen mode 
42 42
 
43  
-    D3D_FEATURE_LEVEL featureLevels = D3D_FEATURE_LEVEL_10_0;
44  
-
45 43
     HRESULT result = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, NULL, NULL, NULL,
46 44
       D3D11_SDK_VERSION, &swapChainDesc, &swapChain_, &device_, NULL, &context_);
47 45
 
48  
-    D3D_FEATURE_LEVEL featureLevel = device_->GetFeatureLevel();
49 46
     assert(result == S_OK);
50 47
   }
51 48
 

0 notes on commit fd0ab07

Please sign in to comment.
Something went wrong with that request. Please try again.