7fd59977 |
1 | /*********************************************************************** |
2 | |
3 | FONCTION : |
4 | ---------- |
5 | Gestion des light sous OpenGL |
6 | |
7 | |
8 | REMARQUES: |
9 | ---------- |
10 | |
11 | HISTORIQUE DES MODIFICATIONS : |
12 | -------------------------------- |
13 | 25-06-97 : PCT ; Appel de la toolkit OpenGl_LightBox |
14 | et correction de bug passage |
15 | plusieurs lights -> aucune lights |
16 | |
17 | ************************************************************************/ |
18 | |
19 | #include <OpenGl_tgl_all.hxx> |
20 | |
21 | #include <InterfaceGraphic_Labels.hxx> |
22 | #include <InterfaceGraphic_Graphic3d.hxx> |
23 | #include <InterfaceGraphic_Visual3d.hxx> |
24 | |
25 | #include <OpenGl_tgl_funcs.hxx> |
26 | #include <OpenGl_tgl_subrvis.hxx> |
27 | #include <OpenGl_inquire.hxx> |
28 | |
29 | #include <OpenGl_LightBox.hxx> |
30 | #include <OpenGl_Memory.hxx> |
31 | |
32 | void EXPORT |
33 | call_togl_setlight |
34 | ( |
35 | CALL_DEF_VIEW * aview |
36 | ) |
37 | { |
38 | Tint *actl=0; |
39 | Tint i; |
40 | CALL_DEF_LIGHT alight; |
41 | CMN_KEY k; |
42 | |
43 | actl = new Tint[call_facilities_list.MaxLights]; |
44 | if( !actl ) |
45 | return; |
46 | |
47 | /* PCT ; 25-06-97 */ |
48 | ResetWksLight(aview->WsId); |
49 | |
50 | for( i =0; i < aview->Context.NbActiveLight && |
51 | i < call_facilities_list.MaxLights; i++ ) |
52 | { |
53 | alight = aview->Context.ActiveLight[i]; |
54 | actl[i] = alight.LightId; |
55 | call_subr_set_light_src_rep( &alight ); |
56 | } |
57 | |
58 | call_func_set_edit_mode(CALL_PHIGS_EDIT_REPLACE); |
59 | call_func_open_struct(aview->ViewId); |
60 | call_func_set_elem_ptr(0); |
61 | call_func_set_elem_ptr_label(View_LABLight); |
62 | call_func_offset_elem_ptr(1); |
63 | k.id = aview->Context.NbActiveLight; |
64 | k.data.pdata = actl; |
65 | TsmAddToStructure( TelLightSrcState, 1, &k ); |
66 | call_func_close_struct(); |
67 | |
68 | delete[] actl; |
69 | |
70 | return; |
71 | } |