Due to forgetting my USB drive, and also that here, at school, I just started discovering openGL's mathematical curves(I think it's called a b-spline?)
Solution? Post it here! I had to rediscover the windows API, and recreate the sequence for opening the window, and stuff. They never blocked bay12, though the title includes GAMES.
Although you could use my stuff, it is only a curve editor, with a slight modification that makes it work similar to how MSPA's spirograph was faked.
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
HDC hDC;
int run=1;
GLfloat ctrlpoints[4][3] = {
{0, 0.4, 0.0}, { 0.0, 0.5, 0.0},
{0.0, 0.6, 0.0}, {0.0, 0.7, 0.0}};
void render()
{
glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4,&ctrlpoints[0][0]);
glEnable(GL_MAP1_VERTEX_3);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0,196,0);
glLineWidth(2);
glLoadIdentity();
int i,j=0;
while(j<10)
{
glBegin(GL_LINE_STRIP);
for (i = 0; i <= 30; i++)
glEvalCoord1f((GLfloat) i/30.0);
glEnd();
j++;
glRotatef(36,0,0,1);
}
glLoadIdentity();
glScalef(-1,1,1);
while(j<20)
{
glBegin(GL_LINE_STRIP);
for (i = 0; i <= 300; i++)
glEvalCoord1f((GLfloat) i/300.0);
glEnd();
j++;
glRotatef(36,0,0,1);
}
SwapBuffers(hDC);
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static int n=0;
static int w=1;
switch(msg)
{
case WM_CLOSE:
DestroyWindow(hwnd);
run=0;
return 0;
case WM_DESTROY:
PostQuitMessage(0);
run=0;
return 0;
case WM_KEYDOWN:
if(wParam==VK_ESCAPE)run=0;
/*if(wParam=='Q')ctrlpoints[n][0]+=0.01;
if(wParam=='A')ctrlpoints[n][0]-=0.01;
if(wParam=='W')ctrlpoints[n][1]+=0.01;
if(wParam=='S')ctrlpoints[n][1]-=0.01;*/
if(wParam=='Z'&&n>0)n--;
if(wParam=='X'&&n<3)n++;
if(wParam=='C')w=!w;
return 0;
case WM_MOUSEMOVE:
if(n>0 && wParam&MK_LBUTTON)
{
ctrlpoints[n][1]=-HIWORD(lParam)/200.0+1;
ctrlpoints[n][0]=LOWORD(lParam)/200.0-1;
}
return 0;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSEX wc;
HWND hwnd;
MSG msg;
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = 0;//(HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName = NULL;
wc.lpszClassName = "AAA";
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
if(!RegisterClassEx(&wc))
return 0;
hwnd = CreateWindowEx(WS_EX_WINDOWEDGE,"AAA","",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,408,434,NULL,NULL,hInstance, NULL);
if(hwnd == NULL)
return 0;
hDC = GetDC(hwnd);
PIXELFORMATDESCRIPTOR pfd;
ZeroMemory(&pfd,sizeof(pfd));
pfd.nSize = sizeof(pfd);
pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
pfd.cDepthBits = 16;
pfd.iLayerType = PFD_MAIN_PLANE;
int iFormat = ChoosePixelFormat( hDC,&pfd);
SetPixelFormat(hDC,iFormat,&pfd);
HGLRC hRC;
hRC = wglCreateContext(hDC);
wglMakeCurrent(hDC,hRC);
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
while(run)
{
while(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
render();
}
wglMakeCurrent(NULL,NULL);
wglDeleteContext(hRC);
ReleaseDC(hwnd,hDC);
return msg.wParam;
}
The purpose of this topic is to store plaintext data, especially C code, that would be perfectly legal and acceptable, and you would send it other ways if you could.
To prevent needless clutter, spoil any large data.