1 /************************************************************************
3 * voxelands - 3d voxel world sandbox game
4 * Copyright (C) Lisa 'darkrose' Milne 2016 <lisa@ltmnet.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>
18 ************************************************************************/
24 #define _WM_EXPOSE_ALL
28 static int state_client
= VLSTATE_PLAY
;
30 /* get/set the client state */
31 int client_state(int s
)
39 int main(int argc
, char** argv
)
56 config_init(argc
,argv
);
65 wm_title(PACKAGE
" - " VERSION
);
67 font_load("font.ttf","default");
69 f
= font_find("default");
71 textbuffer_init(&tb
,f
,14,20,20,0,0,0,0);
72 textbuffer_init(&tb2
,f
,14,20,40,0,0,0,0);
73 i
= textbuffer_addstr(&tb
,"Hello world! - ößäндгя ygj");
75 vlprintf("hello world %d",i
);
77 logo
= mat_from_image("texture","menulogo.png");
78 steel
= mat_from_image("texture","steel_block.png");
79 mud
= mat_from_image("texture","mud.png");
81 mat_shininess(steel
,5.0,0.5);
82 mat_bumpiness(steel
,0.1);
84 mat_bumpiness(mud
,0.8);
89 block1
= render3d_cube(3.0,&p
,mud
);
91 block2
= render3d_cube(3.0,&p
,steel
);
94 while (state_client
!= VLSTATE_EXIT
) {
97 r
+= 45.0*client_dtime();
101 object_rotate(block1
,20.0,r
,-r
);
102 object_rotate(block2
,20.0,-r
,r
);
104 textbuffer_clear(&tb2
);
105 textbuffer_init(&tb2
,f
,14,20,40,0,0,0,0);
106 sprintf(buff
,"FPS: %d",wm_data
.fps
);
107 textbuffer_addstr(&tb2
,buff
);
109 render2d_textbuffer(&tb
);
110 render2d_textbuffer(&tb2
);
112 render2d_quad_mat(logo
,412,150,200,200);
127 int WINAPI
WinMain(HINSTANCE hInstance
, HINSTANCE hPrevInstance
, LPSTR lpCmdLine
, int nCmdShow
)
133 args
= CommandLineToArgvW(GetCommandLineW(), &argc
);
137 argv
= malloc(sizeof(char*));
140 return main(argc
,argv
);