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 ggez; | |
extern crate nalgebra; | |
mod model; | |
use std::time::{Duration}; | |
use ggez::conf; | |
use ggez::event::{self, Mod, Keycode}; | |
use ggez::{GameResult, Context}; |
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
use nalgebra::{Vector2}; | |
pub struct Player { | |
position: Vector2<f32>, | |
} | |
impl Player { | |
pub fn new() -> Self { | |
Player { | |
position: Vector2::new(10.0, 9.0), |
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 sdl2; | |
use sdl2::pixels::{Color}; | |
use sdl2::event::{Event}; | |
use sdl2::keyboard::{Keycode}; | |
use sdl2::image::{LoadTexture, INIT_PNG}; | |
use sdl2::rect::{Rect}; | |
pub fn main() { | |
let sdl_context = sdl2::init().unwrap(); |
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 winapi; | |
extern crate user32; | |
extern crate kernel32; | |
extern crate gdi32; | |
extern crate nalgebra; | |
use std::ffi::{OsStr}; | |
use std::os::windows::ffi::{OsStrExt}; | |
use std::os::raw::{c_void}; | |
use std::ptr::{null_mut}; |
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
[package] | |
name = "shoot-game" | |
version = "0.1.0" | |
authors = ["Layl <LaylConway@users.noreply.github.com>"] | |
[dependencies] | |
winapi = "0.2.8" | |
user32-sys = "0.2.0" | |
kernel32-sys = "0.2.2" | |
gdi32-sys = "0.2.0" |
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 winapi; | |
extern crate user32; | |
extern crate kernel32; | |
use std::ffi::{OsStr}; | |
use std::os::windows::ffi::{OsStrExt}; | |
use std::ptr::{null_mut}; | |
use winapi::winuser::{WNDCLASSW, CS_OWNDC, CS_HREDRAW, CS_VREDRAW, CW_USEDEFAULT, WS_OVERLAPPEDWINDOW, WS_VISIBLE, MSG}; | |
use user32::{DefWindowProcW, RegisterClassW, CreateWindowExW, GetMessageW, TranslateMessage, DispatchMessageW}; |
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
s indexed by attachment number so even if some pClearValues entries between 0 and 6 correspond to attachments that aren't cleared they will be ignored. The spec valid usage text states 'clearValueCount must be greater than the largest attachment index in renderPass that specifies a loadOp (or stencilLoadOp, if the attachment has a depth/stencil format) of VK_ATTACHMENT_LOAD_OP_CLEAR' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkRenderPassBeginInfo-clearValueCount-00902) | |
DS(ERROR): object: 0x59 type: 27 location: 9303 msgCode: 101: vkQueuePresentKHR: Presenting image without calling vkGetPhysicalDeviceSurfaceSupportKHR | |
DS(ERROR): object: 0xaf type: 18 location: 7896 msgCode: 301991692: In vkCmdBeginRenderPass() the VkRenderPassBeginInfo struct has a clearValueCount of 6 but there must be at least 7 entries in pClearValues array to account for the highest index attachment in renderPass 0xaf that uses VK_ATTACHMENT_LOAD_OP_CLEAR is 7. Note that the pClearValues array is indexed by a |
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
pub fn check_intersection(&self, ray: Ray3<f32>, brush: &Brush) -> Option<PlaneIntersection> { | |
let values = self.triangles_planes(brush); | |
for (triangle, plane) in values { | |
// TODO: Check that the triangle is facing the ray before doing a ray hit | |
if let Some(intersection) = (plane, ray).intersection() { | |
let axes = create_axes_for_plane(&plane); | |
let origin = Point3::from_vec(plane.n * plane.d); |
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
{ | |
"brushes": [ | |
{ | |
"vertices": [ | |
{ | |
"x": -1, | |
"y": -1, | |
"z": 1 | |
}, | |
{ |
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
use std::sync::{Arc}; | |
use cgmath::{Vector2, Vector3, Point3, InnerSpace, MetricSpace}; | |
use collision::{Sphere}; | |
use slog::{Logger}; | |
use vulkano::buffer::{CpuAccessibleBuffer, BufferUsage}; | |
use calcium_rendering::{Renderer}; | |
use calcium_rendering_vulkano::{VulkanoRenderer}; | |
use calcium_rendering_world3d::{Vertex, Mesh}; |