forked from versenaut/quelsolaar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
co_main.c
72 lines (63 loc) · 2.31 KB
/
co_main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "st_matrix_operations.h"
#include "enough.h"
#include "seduce.h"
#include "persuade.h"
#include "deceive.h"
//#include "co_func_repository.h"
//#include "co_storage.h"
#include "co_vn_handle.h"
#include "co_vn_graphics.h"
#include "co_widgets.h"
#include "co_projection.h"
extern void co_input_handler(BInputState *input, void *user);
extern void co_intro_handler(BInputState *input, void *user);
extern void co_intro_draw(void *user);
extern void *se_symbol_editor_func(BInputState *input, void *user_pointer);
extern void *se_font_editor_func(BInputState *input, void *user_pointer);
extern void co_intro_init(void);
extern void sp_settings_init(void);
extern void co_update_context_textures(void);
extern void co_node_create_func(uint connection, uint id, VNodeType type, void *user);
extern float co_background_color[3];
extern float co_line_color[3];
void co_context_update(void)
{
glClearColor(co_background_color[0], co_background_color[1], co_background_color[2], 1);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
co_update_context_textures();
p_context_update();
sui_set_blend_gl(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
int main(int argc, char **argv)
{
betray_init(argc, argv, 720, 576, FALSE, "Connector");
deceive_set_arg(argc, argv);
sui_init();
p_init();
glClearColor(1, 1, 1, 1);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
sui_load_settings("co_config.cfg");
co_init_handle_verse_node();
enough_init(); /* initializing the Enough Lib, setting the max subdivision level to 3*/
#ifdef PERSUADE_H
persuade_init(4, betray_get_gl_proc_address());
p_geo_set_sds_level(4);
sp_settings_init();
#endif
co_vng_init();
co_intro_init();
e_nsm_set_custom_func(CO_ENOUGH_NODE_SLOT, material_func);
e_ns_set_node_create_func(co_node_create_func, NULL);
betray_set_context_update_func(co_context_update);
deceive_set_intro_draw_func(co_intro_draw, NULL);
betray_set_action_func(deceive_intro_handler, co_input_handler);
// betray_set_action_func(co_intro_handler, NULL);
// betray_set_action_func(sui_font_editor_func, NULL);
// printf("entering main loop\n");
// e_vc_set_auto_subscribe(V_NT_OBJECT, FALSE);
// e_vc_set_auto_subscribe(V_NT_GEOMETRY, FALSE);
// e_vc_set_auto_subscribe(V_NT_MATERIAL, FALSE);
betray_launch_main_loop();
return 0;
}