$ mklink /d MyNewDir ..\path\to\original\MyOldDir
use /d
flag to create symlink directory otherwise it makes file
path can be relative or absolute
SDL_Texture *renderText(const char *text, bool isUTF8, const char *fontPath, SDL_Color color, int fontSize, SDL_Renderer *renderer) | |
{ | |
TTF_Font *font = TTF_OpenFont(fontPath, fontSize); | |
if (font == NULL) | |
{ | |
//logErrorSDL("Failed to Open Font!"); | |
return NULL; | |
} | |
SDL_Surface *surface; |
#define GLFW_INCLUDE_NONE | |
#include <GLFW/glfw3.h> | |
#include <glad/glad.h> | |
#include <iostream> | |
constexpr float R = 0.2f; | |
constexpr float G = 0.4f; | |
constexpr float B = 0.9f; | |
constexpr float A = 1.0f; |
#include <SDL2/SDL.h> | |
#include <SDL2/SDL_opengl.h> | |
#include <iostream> | |
constexpr float R = 0.2f; | |
constexpr float G = 0.4f; | |
constexpr float B = 0.9f; | |
constexpr float A = 1.0f; |
#include <SFML/Window.hpp> | |
#include <SFML/OpenGL.hpp> | |
#include <iostream> | |
constexpr float R = 0.2f; | |
constexpr float G = 0.4f; | |
constexpr float B = 0.9f; | |
constexpr float A = 1.0f; |
use std::convert::TryInto; | |
use glfw; | |
use glfw::Context; | |
use gl; | |
const WIDTH: u32 = 480; | |
const HEIGHT: u32 = 320; | |
const TITLE: &str = "Hello From OpenGL World!"; |
// Cargo.toml | |
// ------------------------ | |
// [dependencies] | |
// glfw = "0.41.0" | |
// gl = "0.14.0" | |
use glfw::{self, Context}; | |
use gl; | |
const WIDTH: u32 = 480; |
// get OpenGL version in rust | |
fn gl_get_string<'a>(name: gl::types::GLenum) -> &'a str { | |
let v: *const u8 = unsafe { gl::GetString(name) }; | |
let v: &std::ffi::CStr = unsafe { std::ffi::CStr::from_ptr(v as *const i8) }; | |
v.to_str().unwrap() | |
} |
// Cargo.toml | |
// ------------------------ | |
// [dependencies] | |
// # on Windows OS don't forget to copy native CSFML *.dll & *.lib files next to your project Cargo.toml file | |
// sfml = "0.16.0" | |
// I did not find any way to use OpenGL with SFML, | |
// if you know a way I will be happy to hear it ;-) | |
// But you can still use the library with the same template |
// Cargo.toml | |
// ----------------------- | |
// [dependencies] | |
// gl = "0.14.0" | |
// [dependencies.sdl2] | |
// version = "0.34.5" | |
// features = ["bundled", "static-link"] | |
use std::thread; |