This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <SDL2/SDL.h> | |
//It seems only XInput controllers are detected as game controllers | |
void xinputTest(); | |
void dinputTest(); | |
int main(int argc, char **argv){ | |
if (SDL_Init(SDL_INIT_EVENTS | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER) != 0){ | |
std::cout << "Init failed" << std::endl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#ifdef __linux__ | |
#include <SDL2/SDL.h> | |
#elif defined(_WIN32) | |
#include <SDL.h> | |
#endif | |
const int WIN_WIDTH = 640; | |
const int WIN_HEIGHT = 480; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate sparse_matrix; | |
use sparse_matrix::{MatrixElement, SparseMatrix}; | |
fn conjugate_gradient(matrix: &SparseMatrix, b: &Vec<f32>) -> Vec<f32> { | |
let mut r = b.clone(); | |
let mut p = b.clone(); | |
let mut x = Vec::from_elem(b.len(), 0f32); | |
let mut r_dot_r = [sparse_matrix::dot(&r, &r), 0f32]; | |
let mut step = 0u; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | |
| CLK_FILTER_NEAREST; | |
__kernel void processImg(read_only image2d_t srcImg, write_only image2d_t outImg){ | |
//uint offset = get_global_id(1) * 0x4000 + get_global_id(0) * 0x1000; | |
int2 coord = (int2)(get_global_id(0), get_global_id(1)); | |
uint4 pixel = read_imageui(srcImg, sampler, coord); | |
write_imageui(outImg, coord, pixel); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.5) | |
project(sdl2_test) | |
find_package(SDL2 REQUIRED) | |
find_package(OpenGL REQUIRED) | |
find_package(TBB REQUIRED) | |
add_executable(sdl2_test | |
main.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "render_optix.h" | |
#include <algorithm> | |
#include <array> | |
#include <chrono> | |
#include <cstring> | |
#include <iostream> | |
#include <numeric> | |
#include <cuda.h> | |
#include <cuda_gl_interop.h> | |
#include <cuda_runtime_api.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uniform int i = 0; | |
foreach_unique(b in blockID) { | |
unmasked { | |
i = i + 1; | |
} | |
} | |
print("unique blocks: %\n", i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.0) | |
project(OspExample) | |
# To build provide the path to your osprayConfig.cmake included in the OSPRay | |
# releases to CMake as "-Dospray_DIR=<..>" | |
# and the path to the embreeConfig.cmake from the Embree releases similarly | |
# as "-Dembree_DIR=<..>" | |
find_package(ospray REQUIRED) | |
include_directories(${OSPRAY_INCLUDE_DIRS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.5) | |
project(osp-transparency-bug) | |
set(CMAKE_CXX_STANDARD 14) | |
add_definitions(-DNOMINMAX) | |
find_package(ospray REQUIRED) | |
include_directories(${OSPRAY_INCLUDE_DIRS}) | |
add_executable(transparency-test transparency-test.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <thread> | |
#include <chrono> | |
#include <sys/times.h> | |
#include <sys/time.h> | |
#include <sys/types.h> | |
#include <sys/resource.h> | |
#include <unistd.h> | |
#include <fstream> |
NewerOlder