This file contains hidden or 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
void application::init() { | |
if (!glfwInit()) | |
throw runtime_error::dead_ctor("Cannot initialize GLFW"); | |
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); | |
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2); | |
if (glfwOpenWindow(_width, _height, 0, 0, 0, 0, 0, 0, (_fullscreen ? GLFW_FULLSCREEN : GLFW_WINDOW_NO_RESIZE))) { | |
glfwTerminate(); | |
throw runtime_error::dead_ctor("Cannot open a window"); | |
} |
This file contains hidden or 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
auto &vs = _vsLoader.from_disk("../../src/vs.glsl"); | |
auto &fs = _fsLoader.from_disk("../../src/fs.glsl"); | |
/* shader part */ | |
vs.compile(); | |
fs.compile(); | |
_sp.attach(vs); | |
_sp.attach(fs); | |
_sp.link(); |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
pthread_mutex_t mutex; | |
int *played; | |
int *scores; |
This file contains hidden or 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
enum resource_type { A, B, C, D, E, UNKNOWN } | |
class foo { | |
this(resource_type rt) { | |
switch (rt) { | |
/* do shit here depending on the type of rt */ | |
default :; | |
} |
This file contains hidden or 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
[email protected] ~/Code/space_defence % git checkout unstable 17:19:33 | |
Switched to branch 'unstable' | |
[email protected] ~/Code/space_defence % ls include/view 17:19:40 | |
frame.hpp gui.hpp view_interface.hpp | |
[email protected] ~/Code/space_defence % git checkout unstable-view 17:19:44 | |
Switched to branch 'unstable-view' | |
[email protected] ~/Code/space_defence % git clean -ndx 17:19:59 | |
[email protected] ~/Code/space_defence % ls include/view 17:20:08 | |
Button.hpp GUI.hpp Text.hpp WidgetComposite.hpp | |
Frame.hpp Listeners.hpp WidgetBase.hpp |
This file contains hidden or 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
void platform_controller::select_platform(select_mode m) { | |
switch (m) { | |
case NONE : | |
_selected = 0; | |
break; | |
case CLUSTER : | |
/* ... */ | |
break; | |
This file contains hidden or 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
class A { | |
void foo() { | |
writeln("in A.foo()"); | |
} | |
} | |
class B : A { | |
void foo() { /* WARNING ici, on "devrait" utiliser override */ | |
writeln("in B.foo()"); | |
} |
This file contains hidden or 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
private void generate_mines_() { | |
auto new_mine_index_() { | |
auto index = [ uniform(0u, _height), uniform(0u, _width) ]; | |
/* check if index is in _mines. if is, loop again till find a good index */ | |
return index; | |
} | |
while (_mines.length < _minesNb) { | |
/* TODO */ | |
} |
This file contains hidden or 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
module lol; | |
import std.stdio; | |
class A { | |
this() { | |
debug writeln("ctor"); | |
} | |
~this() { |
This file contains hidden or 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
bool run(gfx &gfx, ms_t p) { | |
auto *f = _intervals.front(); | |
if (!f->running(p)) { | |
_intervals.pop(); | |
if (_intervals.empty()) | |
return false; | |
f = _intervals.front(); | |
} | |