Posted: Sun Oct 17, 2004 1:30 pm
Hi Max.²
Thanks for the link. It also handles net (clr), it seems.
Thanks for the link. It also handles net (clr), it seems.
http://www.purebasic.com
https://www.purebasic.fr/english/
What do you mean with "based on..."?Moonshine wrote:Max.²: Ive downloaded that already (despite having no C/C++ knowledge) but is it all based on the .net framework or what?
Code: Select all
cl -W1 -Gz -Ze /O2 /Ox /J /G7 /arch:SSE2 /Fosourcecode.obj /c sourcecode.c
pause
c:\programme\PellesC\bin\polib /machine:ix86 sourcecode.obj another.obj -out:Lib\purebasic.lib
pause
Sorry if I did confuse you but I ment the footprint of the compiler & libs... 8Othefool wrote:50+ megs footprint??
i made a 3 kb hello world with devc++
Code: Select all
// minimal.c--
// Tested on Win2000
// Compiled with Sphinx C-- Compiler Version 0.239c b4 Feb 10 2003
//
// Skeleton of a minimal Win32 GUI app, written in Sphinx C--
//
// To compile, need "c--.exe" in same directory or in DOS path.
// The "#includepath" has path of the Windows header files.
// To compile, just type "c-- Minimal" -- that's it.
// INIT stuff
#pragma option w32 //create Windows GUI EXE.
#pragma option J0 //no startup code.
#pragma option dbg //create debug information (separate .tds file).
#pragma option lst //generate listing file.
#pragma option w //enable warning.
#pragma option 3 //386 CPU.
#includepath "\sphinx\lib\win"
#include "windef.h--"
#include "winbase.h--" //kernel32.dll
#include "wingdi.h--" //gdi32.dll
#include "winuser.h--" //user32.dll
#pragma option ia //no need "$" or "asm" for inline asm.
// Variables used by main()...
dword g_hinst=0;
dword g_hwnd=0;
struct WNDCLASS s1;
struct MSG s2;
dword g_hstandardbrush=0; // handle of background
char szTitleName="MINIMAL";
char szClassName="MINIMAL";
main()
{
GetModuleHandle(NULL); //startup code.
mov g_hinst,eax // /
// initialize the WndClass structure...
s1.style=CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
s1.lpfnWndProc=#WNDproc;
s1.cbClsExtra=s1.cbWndExtra=0;
s1.hInstance=g_hinst;
s1.hCursor=LoadCursorA(0,IDC_ARROW);
// Background stuff..
GetSysColorBrush(COLOR_BTNFACE); //returns brush for window background.
mov g_hstandardbrush,eax
mov s1.hbrBackground,eax //COLOR_WINDOW + 1
mov s1.lpszMenuName,#szClassName
mov s1.lpszClassName,#szClassName
RegisterClass(#s1);
test eax,eax
jnz NOT_END //end_loop //exit if eax=0.
jmp end_loop
NOT_END:
CreateWindowEx(0,#szClassName,#szTitleName,WS_OVERLAPPEDWINDOW,5,5,300,200,0,0,g_hinst,0);
test eax,eax
jz end_loop //exit if eax=0.
mov g_hwnd,eax
ShowWindow(g_hwnd,SW_SHOWNORMAL);
UpdateWindow(g_hwnd);
msg_loop:
GetMessage(#s2,0,0,0);
or eax,eax //cmp eax,0
je end_loop
TranslateMessage(#s2);
DispatchMessage(#s2);
jmp msg_loop
end_loop:
ExitProcess(s2.wParam);
}
// ..........................................................
// main callback procedure
// ..........................................................
dword WNDproc(dword hwnd,wmsg,wparam,lparam)
{
dword hdc;
dword hbrushsaved;
switch(wmsg)
{
case WM_DESTROY: //DestroyWindow() generates this.
PostQuitMessage(0);
//...main() will get this and call ExitProcess() (see above).
break;
// case WM_COMMAND:
// case WM_PAINT:
default:
DefWindowProc(hwnd,wmsg,wparam,lparam);
jmp short getout
//...note could have "return;" here but want common exit point.
}
xor eax,eax //return 0 if have processed msg here.
getout:
}
// ..........................................................
// end code
// ..........................................................
Code: Select all
#pragma option w32
#includepath "..\wxCmm"
#include "wxCmm.h--"
wxFrame frame;
void wxMain()
{
frame.wxFrame(NULL, -1, "A minimal wxCmm example");
frame.Show();
}
I managed to get an OpenGL window (plus numerous unused functions, custom callback & message loop etc) in 6.5k.fsw wrote:BTW: PureBasic's minimal Window boils down nowadays to 10kb.