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
)
62 config_init(argc
,argv
);
71 wm_title(PACKAGE
" - " VERSION
);
74 f
= font_find("default");
76 textbuffer_init(&tb
,f
,14,20,20,0,0,0,0);
77 textbuffer_init(&tb2
,f
,14,20,40,0,0,0,0);
78 i
= textbuffer_addstr(&tb
,"Hello world! - ößäндгя ygj");
80 vlprintf("hello world %d",i
);
92 logo
= mat_from_image("texture","menulogo.png");
93 steel
= mat_from_image("texture","steel_block.png");
94 mud
= mat_from_image("texture","mud.png");
95 glass
= mat_from_colour(&glasscolour
);
96 ice
= mat_from_colour(&icecolour
);
98 mat_shininess(steel
,5.0,0.5);
99 mat_bumpiness(steel
,0.1);
101 mat_bumpiness(mud
,0.8);
104 mat_shininess(ice
,8.0,0.2);
106 mat_options(glass
,0);
107 mat_shininess(glass
,2.0,0.8);
112 mudblock
= render3d_cube(3.0,&p
,mud
);
114 steelblock
= render3d_cube(3.0,&p
,steel
);
117 glassblock
= render3d_cube(3.0,&p
,glass
);
119 iceblock
= render3d_cube(3.0,&p
,ice
);
122 while (state_client
!= VLSTATE_EXIT
) {
125 r
+= 45.0*client_dtime();
129 object_rotate(mudblock
,20.0,r
,-r
);
130 object_rotate(steelblock
,20.0,-r
,r
);
131 object_rotate(glassblock
,20.0,-r
,-r
);
132 object_rotate(iceblock
,20.0,r
,r
);
134 textbuffer_clear(&tb2
);
135 sprintf(buff
,"FPS: %d",wm_data
.fps
);
136 textbuffer_addstr(&tb2
,buff
);
138 render2d_textbuffer(&tb
);
139 render2d_textbuffer(&tb2
);
141 render2d_quad_mat(logo
,412,150,200,200);
156 int WINAPI
WinMain(HINSTANCE hInstance
, HINSTANCE hPrevInstance
, LPSTR lpCmdLine
, int nCmdShow
)
162 args
= CommandLineToArgvW(GetCommandLineW(), &argc
);
166 argv
= malloc(sizeof(char*));
169 return main(argc
,argv
);