Skip to content

Instantly share code, notes, and snippets.

@ecere
ecere / gist:5418159
Last active December 16, 2015 10:09
import "ecere"
class SlidingPanel : Window
{
bool dragging;
Point startScroll, startDrag;
bool OnLeftButtonDown(int x, int y, Modifiers mods)
{
startScroll = scroll;
startDrag = { x, y };
@ecere
ecere / gist:5417973
Last active December 16, 2015 10:09
import "ecere"
class Form1 : Window
{
caption = "Form1";
background = activeBorder;
borderStyle = sizable;
hasMaximize = true;
hasMinimize = true;
hasClose = true;
import "ecere"
void SomeFunction(Form1 form, void method(Form1, int))
{
method(form, 3);
}
class Form1 : Window
{
caption = "Form1";
public Type ProcessType(OldList specs, Declarator decl)
{
return _ProcessType(specs, decl, null);
}
public Type _ProcessType(OldList specs, Declarator decl, Type parentType)
{
Type type = parentType;
Declarator subDecl = decl ? decl.declarator : null;
if(!parentType)
#define PUTXWORD(b, w) \
(b)[0] = (byte)(((w) >> 8) & 0xFF); \
(b)[1] = (byte)(((w) ) & 0xFF);
#define GETXWORD(b) (uint16)(((b)[0] << 8) | (b)[1])
void Test()
{
int const * * foo; // this prevents you from doing: **foo = 0;
int * const * bar; // this prevents you from doing: *bar = 0;
int * * const two; // this prevents you from doing: two = 0;
**foo = 0;
*bar = 0;
two = 0;
}
public Declarator GetFuncDecl(Declarator decl)
{
Declarator funcDecl = null;
while(decl && decl.type != identifierDeclarator)
{
decl = decl.declarator;
if(decl.type == functionDeclarator)
funcDecl = decl;
}
return funcDecl;
public Declarator GetFuncDecl(Declarator decl)
{
while(decl && decl.type != functionDeclarator && decl.type != identifierDeclarator)
decl = decl.declarator;
return (decl && decl.type == functionDeclarator) ? decl : null;
}
//VESA FUNCTION 02
/*
=================
VID_SetMode
=================
*/
void VID_SetMode(WORD mode)
{
__dpmi_regs r;
public struct Light
{
LightFlags flags;
ColorRGB ambient;
ColorRGB diffuse;
ColorRGB specular;
Vector3D direction;
Quaternion orientation;
Object lightObject;
Object target;