Skip to content

Instantly share code, notes, and snippets.

static int pv_enter = 0;
static int pv_exit = 1;
void CSDKGameRules::CalculateSlowMoForPlayer(CSDKPlayer* pPlayer)
{
/*pv_enter should always be less than pv_exit.
If it isn't then it means this function is getting called asynchronously.
pv_enter and pv_exit are incremented at opposing sides of the function,
this is a cheap bid to increase the resolution of this diagnostic.*/
Assert (pv_enter < pv_exit);
if (!pPlayer)
@BSVino
BSVino / gist:7425335
Created November 12, 2013 04:09
This code for background movies in Source SDK 2013 used to run with Bink but Bink support was removed for the SDK 2013 update is broken and I'm in no mood to fix the code.
enum
{
MAINMENU_NONE, //start here
MAINMENU_STARTVIDEO, //start video
MAINMENU_STOPVIDEO, //stop video
};
// The CDAMainMenu class graciously donated by Tony Sergi, from Project Valkyrie.
class CDAMainMenu : public vgui::Panel
#!/bin/bash
pushd `dirname $0`
devtools/bin/vpc_linux +shadereditor /hl2 /h /mksln shadereditor
popd
...
vino@vino-desktop:~/git/source-shader-editor/src$ ./createshadereditorprojects
~/git/source-shader-editor/src ~/git/source-shader-editor/src
diff -Nuar vgui_controls/analogbar.cpp vgui_editor/analogbar.cpp
--- vgui_controls/analogbar.cpp 2014-07-30 12:53:43.295871881 -0700
+++ vgui_editor/analogbar.cpp 2014-07-30 13:01:35.118830789 -0700
@@ -8,8 +8,8 @@
#include <math.h>
#include <stdio.h>
-#include <vgui_controls/AnalogBar.h>
-#include <vgui_controls/Controls.h>
+#include <vgui_controls/analogbar.h>
struct your_struct;
typedef void(*your_function_foo)(your_struct* s);
typedef struct {
your_function_foo f;
} your_struct;
docs.gl
=======
[docs.gl](http://docs.gl) is a public domain web scaffolding for the OpenGL documentation.
The actual documentation website provided by Khronos is in frames and poorly formatted,
difficult to navigate and search.
https://dl.dropboxusercontent.com/u/4205810/all-opengl-docs.zip

docs.gl

docs.gl is a public domain web scaffolding for the OpenGL documentation. The actual documentation website provided by Khronos is in frames and poorly formatted, difficult to navigate and search. docs.gl aims to improve the form factor and quality of the OpenGL documentation.

Contributions Welcome

#if 1
#if 0
if (stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE)
{
for (; x < max_x; x++)
{
int decode_pixel_index = x * channels;
int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels;
for (c = 0; c < channels; c++)
decode_buffer[decode_pixel_index + c] = stbir__srgb_uchar_to_linear_float[((const unsigned char*)input_data)[input_pixel_index + c]];
@BSVino
BSVino / gist:585d4c74eb746bdbdf9bd7c60ffffded
Last active October 16, 2016 23:11
Debugging Sample Program
#include "stdafx.h"
#include <vector>
struct Widget {
int a, b, c, d;
long f;
long g[10];
long h;
};
#include "stdafx.h"
#include <emmintrin.h>
#include <limits>
int main(int argc, const char** args)
{
_controlfp(~_EM_INVALID, _MCW_EM);
double doubles[] = { 5, std::numeric_limits<double>::quiet_NaN() };