that was a pain. Got it working on windows again. MSVC was being really

picky about a few errors. Good thing though, I'm not really sure why
clang + osx let me be that lax with memory
This commit is contained in:
MitchellHansen
2016-09-03 19:23:50 -07:00
parent 9c99f9edd0
commit f487895f9f
6 changed files with 173 additions and 142 deletions

View File

@@ -9,9 +9,12 @@
#include <CL/opencl.h>
#elif defined _WIN32
#include <windows.h>
#include <CL/cl_gl.h>
#include <CL/cl.h>
#include <CL/opencl.h>
#include <GL/GL.h>
#include <windows.h>
#elif defined TARGET_OS_MAC
@@ -66,12 +69,13 @@ int main() {
sf::Texture t;
CL_Wrapper c;
query_platform_devices();
c.acquire_platform_and_device();
c.create_shared_context();
c.create_command_queue();
c.compile_kernel("../kernels/kernel.c", true, "hello");
c.compile_kernel("../kernels/minimal_kernel.c", true, "min_kern");
//c.compile_kernel("../kernels/kernel.cl", true, "hello");
c.compile_kernel("../kernels/minimal_kernel.cl", true, "min_kern");
sf::Vector3i map_dim(MAP_X, MAP_Y, MAP_Z);
Map* map = new Map(map_dim);
@@ -101,7 +105,7 @@ int main() {
// SFML 2.4 has Vector4 datatypes.......
float view_matrix[view_res.x * view_res.y * 4];
float* view_matrix = new float[WINDOW_X * WINDOW_Y * 4];
for (int y = -view_res.y / 2; y < view_res.y / 2; y++) {
for (int x = -view_res.x / 2; x < view_res.x / 2; x++) {