Skip to content

Commit

Permalink
Fix G5 compile
Browse files Browse the repository at this point in the history
  • Loading branch information
luboslenco committed Jul 15, 2018
1 parent 4af3260 commit 3ac4e55
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 51 deletions.
37 changes: 8 additions & 29 deletions Backends/Graphics5/Direct3D12/Sources/Kore/Direct3D12.cpp
Expand Up @@ -268,34 +268,17 @@ namespace {

void Graphics5::destroy(int window) {}

void Graphics5::_resize(int window, int width, int height) {

}

void Graphics5::init(int window, int depthBufferBits, int stencilBufferBits, bool vsync) {
HWND hwnd = (HWND)System::windowHandle(window);
HWND hwnd = Window::get(window)->_data.handle;
renderTargetWidth = System::windowWidth(window);
renderTargetHeight = System::windowHeight(window);
initialize(renderTargetWidth, renderTargetHeight, hwnd);

#ifdef KORE_WINDOWS
if (System::hasShowWindowFlag()) {
ShowWindow(hwnd, SW_SHOWDEFAULT);
UpdateWindow(hwnd);
}
#endif

//**begin(window);
}

void Graphics5::changeResolution(int width, int height) {}

void Graphics5::setup() {}

void Graphics5::makeCurrent(int window) {}

void Graphics5::clearCurrent() {}

// void* Graphics::getControl() {
// return nullptr;
//}

/*void Graphics5::drawIndexedVertices() {
// Program::setConstants();
// context->DrawIndexed(IndexBuffer::_current->count(), 0, 0);
Expand Down Expand Up @@ -378,15 +361,11 @@ void Graphics5::end(int window) {
began = false;
}

bool Graphics5::vsynced() {
return vsync;
}

unsigned Graphics5::refreshRate() {
return hz;
bool Kore::Window::vSynced() {
return true;
}

bool Graphics5::swapBuffers(int window) {
bool Graphics5::swapBuffers() {
Microsoft::affirm(swapChain->Present(1, 0));
return true;
}
Expand Down
2 changes: 2 additions & 0 deletions Backends/Graphics5/G5onG4/Sources/Kore/G5onG4.cpp
Expand Up @@ -16,6 +16,8 @@ namespace Kore {

void Graphics5::destroy(int window) {}

void Graphics5::_resize(int window, int width, int height) {}

void Graphics5::init(int window, int depthBufferBits, int stencilBufferBits, bool vsync) {
Graphics4::init(window, depthBufferBits, stencilBufferBits, vsync);
}
Expand Down
4 changes: 4 additions & 0 deletions Backends/Graphics5/Metal/Sources/Kore/Metal.mm
Expand Up @@ -27,6 +27,10 @@

}

void Graphics5::_resize(int window, int width, int height) {

}

void Graphics5::init(int, int, int, bool) {
// System::createWindow();

Expand Down
26 changes: 6 additions & 20 deletions Backends/Graphics5/Vulkan/Sources/Kore/Vulkan.cpp
Expand Up @@ -211,15 +211,9 @@ bool memory_type_from_properties(uint32_t typeBits, VkFlags requirements_mask, u

void Graphics5::destroy(int windowId) {}

#if defined(KORE_WINDOWS)
void Graphics5::setup() {}
#endif

void Graphics5::changeResolution(int width, int height) {}

void Graphics5::clearCurrent() {}
void Graphics5::_resize(int window, int width, int height) {

void Graphics5::makeCurrent(int contextId) {}
}

void Graphics5::init(int windowId, int depthBufferBits, int stencilBufferBits, bool vsync) {
uint32_t instance_extension_count = 0;
Expand Down Expand Up @@ -493,7 +487,7 @@ void Graphics5::init(int windowId, int depthBufferBits, int stencilBufferBits, b
height = System::windowHeight(windowId);

#ifdef KORE_WINDOWS
windowHandle = (HWND)System::windowHandle(windowId);
windowHandle = (HWND)Window::get(windowId)->_data.handle;
ShowWindow(windowHandle, SW_SHOW);
SetForegroundWindow(windowHandle); // Slightly Higher Priority
SetFocus(windowHandle); // Sets Keyboard Focus To The Window
Expand Down Expand Up @@ -917,25 +911,17 @@ void Graphics5::init(int windowId, int depthBufferBits, int stencilBufferBits, b
begin(nullptr);
}

unsigned Graphics5::refreshRate() {
return 60;
}

bool Graphics5::vsynced() {
return false;
bool Kore::Window::vSynced() {
return true;
}

// void* Graphics::getControl() {
// return nullptr;
//}

void Graphics5::drawIndexedVerticesInstanced(int instanceCount) {
// drawIndexedVerticesInstanced(instanceCount, 0, IndexBufferImpl::current->count());
}

void Graphics5::drawIndexedVerticesInstanced(int instanceCount, int start, int count) {}

bool Graphics5::swapBuffers(int contextId) {
bool Graphics5::swapBuffers() {
return true;
}

Expand Down
8 changes: 6 additions & 2 deletions Backends/System/Windows/Sources/Kore/System.cpp
@@ -1,6 +1,8 @@
#include "pch.h"

#ifdef KORE_G4
#ifdef KORE_G4ONG5
#include <Kore/Graphics5/Graphics.h>
#elif KORE_G4
#include <Kore/Graphics4/Graphics.h>
#else
#include <Kore/Graphics3/Graphics.h>
Expand Down Expand Up @@ -37,7 +39,9 @@
#include <exception>
#include <shlobj.h>

#ifdef KORE_G4
#ifdef KORE_G4ONG5
#define Graphics Graphics5
#elif KORE_G4
#define Graphics Graphics4
#else
#define Graphics Graphics3
Expand Down
2 changes: 2 additions & 0 deletions Sources/Kore/Graphics5/Graphics.h
Expand Up @@ -133,6 +133,8 @@ namespace Kore {
void end(int window = 0);
bool swapBuffers();

void _resize(int window, int width, int height);

void setTextureAddressing(TextureUnit unit, TexDir dir, TextureAddressing addressing);
void setTextureMagnificationFilter(TextureUnit texunit, TextureFilter filter);
void setTextureMinificationFilter(TextureUnit texunit, TextureFilter filter);
Expand Down

0 comments on commit 3ac4e55

Please sign in to comment.