Conversion of auld's 4kb framework ported to the current version of
purebasic. attached example file is 2.560 bytes uncompressed.
; *** 4K Framework for PureBasic [Win]
; ***
; *** original framework by auld
; *** pb-conversion by benny!weltenkonstrukteur.de
; ***
IncludeFile "OpenGL.pbi"
Procedure do4KIntro()
glClear_(#GL_DEPTH_BUFFER_BIT | #GL_COLOR_BUFFER_BIT);
glRotatef_(0.5,1.0,1.0,1.0);
glBegin_(#GL_TRIANGLES);
glColor3f_(1.0,0.0,0.0);
glVertex3f_(0.0,-1.0,0.0);
glColor3f_(0.0,1.0,0.0);
glVertex3f_(1.0,1.0,0.0);
glColor3f_(0.0,0.0,1.0);
glVertex3f_(-1.0,1.0,0.0);
glEnd_();
EndProcedure
pfd.PIXELFORMATDESCRIPTOR
pfd\cColorBits = 32
pfd\cDepthBits = 32
pfd\dwFlags = #PFD_SUPPORT_OPENGL | #PFD_DOUBLEBUFFER
hDC = GetDC_ ( CreateWindow_("edit", 0, #WS_POPUP | #WS_VISIBLE | #WS_MAXIMIZE, 0, 0 ,0 ,0, 0 ,0 ,0, 0 ) )
SetPixelFormat_ ( hDC, ChoosePixelFormat_( hDC, pfd), pfd )
wglMakeCurrent_ ( hDC, wglCreateContext_(hDC) )
ShowCursor_(#False);
Repeat
glClear_ ( #GL_DEPTH_BUFFER_BIT | #GL_COLOR_BUFFER_BIT )
do4KIntro()
SwapBuffers_ ( hDC );
Until ( GetAsyncKeyState_ (#VK_ESCAPE) )