- // savez-vous quel est l'arbre syntaxique qui correspond à ce code pour gcc ?
-
-
- typedef int HWND,WNDCLASS,MSG,LPSTR,DWORD,HBRUSH,Uint32,Byte,HINSTANCE;
-
-
- int WinMain (HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
- {
- HWND hwnd;
- WNDCLASS wc;
- MSG msg;
- wc.style = 0;
- wc.lpfnWndProc = MainWndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hinstance;
- wc.hIcon = LoadIconA(((void *)0), (LPSTR)((DWORD)((WORD)(32512))));
- wc.hCursor = LoadCursorA(((void *)0), (LPSTR)((DWORD)((WORD)(32512))));
- wc.hbrBackground = (HBRUSH) (1 + 15);
- wc.lpszMenuName = ((void *)0);
- wc.lpszClassName = "MaWinClass";
- if(!RegisterClassA(&wc)) return 0;
- hwnd = CreateWindowExA(0,"MaWinClass","Essai SDL + API Win32",0xcf0000,0x80000000,0x80000000,800,600,((void *)0),((void *)0),hinstance,((void *)0));
- if(!hwnd) return 0;
- char windowid[100];
- hwnd;
- strcpy(windowid, "SDL_WINDOWID=" );
- _ltoa((long)hwnd, windowid+13, 10);
- _putenv(windowid);
- SDL_Init(0x00000020);
- SDL_Surface *ecran = ((void *)0), *photo = ((void *)0);
- ecran = SDL_SetVideoMode(800, 600, 32, 0x00000001);
- int i,j;
- for (i = 0; i < 800; i++) {
- for (j = 0; j < 600; j++) {
- ((Uint32*)ecran->pixels)[j*800+i] = ((COLORREF)((BYTE)(i*255/800)|((BYTE)(j*255/600) << 8)|((BYTE)((i+j)*255/1400) << 16)));
- }
- }
- SDL_Flip(ecran);
-
- ShowWindow(hwnd, nCmdShow);
- UpdateWindow(hwnd);
-
-
- while(GetMessageA(&msg, hwnd, 0, 0))
- {
- TranslateMessage(&msg);
- DispatchMessageA(&msg);
- }
- msg.wParam;
- }
// savez-vous quel est l'arbre syntaxique qui correspond à ce code pour gcc ?
typedef int HWND,WNDCLASS,MSG,LPSTR,DWORD,HBRUSH,Uint32,Byte,HINSTANCE;
int WinMain (HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
HWND hwnd;
WNDCLASS wc;
MSG msg;
wc.style = 0;
wc.lpfnWndProc = MainWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hinstance;
wc.hIcon = LoadIconA(((void *)0), (LPSTR)((DWORD)((WORD)(32512))));
wc.hCursor = LoadCursorA(((void *)0), (LPSTR)((DWORD)((WORD)(32512))));
wc.hbrBackground = (HBRUSH) (1 + 15);
wc.lpszMenuName = ((void *)0);
wc.lpszClassName = "MaWinClass";
if(!RegisterClassA(&wc)) return 0;
hwnd = CreateWindowExA(0,"MaWinClass","Essai SDL + API Win32",0xcf0000,0x80000000,0x80000000,800,600,((void *)0),((void *)0),hinstance,((void *)0));
if(!hwnd) return 0;
char windowid[100];
hwnd;
strcpy(windowid, "SDL_WINDOWID=" );
_ltoa((long)hwnd, windowid+13, 10);
_putenv(windowid);
SDL_Init(0x00000020);
SDL_Surface *ecran = ((void *)0), *photo = ((void *)0);
ecran = SDL_SetVideoMode(800, 600, 32, 0x00000001);
int i,j;
for (i = 0; i < 800; i++) {
for (j = 0; j < 600; j++) {
((Uint32*)ecran->pixels)[j*800+i] = ((COLORREF)((BYTE)(i*255/800)|((BYTE)(j*255/600) << 8)|((BYTE)((i+j)*255/1400) << 16)));
}
}
SDL_Flip(ecran);
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
while(GetMessageA(&msg, hwnd, 0, 0))
{
TranslateMessage(&msg);
DispatchMessageA(&msg);
}
msg.wParam;
}