Skip to content

Instantly share code, notes, and snippets.

View zehel2892's full-sized avatar

Sayan Bhattacharjee zehel2892

View GitHub Profile
@zehel2892
zehel2892 / read-write-file.js
Last active August 29, 2015 14:27
Read Write to file with javascript
/// write to file
var txtFile = "c:/test.txt";
var file = new File(txtFile);
var str = "My string of text";
file.open("w"); // open file with write access
file.writeln("First line of text");
file.writeln("Second line of text " + str);
file.write(str);
file.close();
@zehel2892
zehel2892 / heightmap.gd
Created November 2, 2015 08:44
Heightmap script for the Godot game engine
tool
extends MeshInstance
export(ImageTexture) var heightmap setget set_heightmap, get_heightmap
export(float, 0.1, 25, 0.1) var factor = 5 setget set_factor, get_factor
export(int, 1, 500) var resolution = 32 setget set_resolution, get_resolution
export(int, 1, 200) var size = 50 setget set_size, get_size
var mesh_builder
@zehel2892
zehel2892 / sdl2_opengl.c
Created November 26, 2015 06:59 — forked from exavolt/sdl2_opengl.c
Very basic SDL2 OpenGL application
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
@zehel2892
zehel2892 / Componet-Entity-Observer-prototype.cpp
Created December 16, 2015 06:45
Using pointer to base class to call functions from derived class using another independent class
#include <iostream>
#include <vector>
using namespace std;
class Base{
public:
Base(){}
~Base(){}
virtual void Write(){
cout<<"Base"<<endl;
@zehel2892
zehel2892 / README.md
Created December 20, 2015 07:14 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@zehel2892
zehel2892 / sdl_key_translation_sample.cc
Created February 14, 2016 10:07 — forked from khrona/sdl_key_translation_sample.cc
Example of how to translate SDL Key Events into Awesomium Keyboard Events
/// Forward declaration
int getWebKeyFromSDLKey(SDLKey key);
///
/// Inject an SDL Key Event into a given WebView
///
void handleSDLKeyEvent(Awesomium::WebView* webView, const SDL_Event& event) {
if (!(event.type == SDL_KEYDOWN || event.type == SDL_KEYUP))
return;
@zehel2892
zehel2892 / SDL_plus_modern_OpenGL.cpp
Created February 14, 2016 13:39
This is the first code that ran correctly with correct shaders and mesh creation for SDL2 and modern OpenGL. Display class is taken from previous project.
#include<iostream>
#include"display.h"
#include<SDL2/SDL.h>
#include<GL/glew.h>
//#include "shader.h"
//#include "mesh.h"
using namespace ns_OCTAD::ns_display;