OCC22150 Problem with GetWindowLong function on 64-bit platform
[occt.git] / src / OpenGl / OpenGl_dotexturemap.cxx
CommitLineData
7fd59977 1/***********************************************************************
2
3FONCTION :
4----------
5File OpenGl_dotexturemap.c :
6
7
8REMARQUES:
9----------
10
11
12HISTORIQUE DES MODIFICATIONS :
13--------------------------------
1419-08-97 : FMN ; ajout texture mapping
15
16************************************************************************/
17
18/*----------------------------------------------------------------------*/
19/*
20* Includes
21*/
22
23
24#include <OpenGl_tgl_all.hxx>
25
26#include <stddef.h>
27#include <stdio.h>
28
29#include <OpenGl_cmn_varargs.hxx>
30#include <OpenGl_telem_attri.hxx>
31#include <OpenGl_tsm.hxx>
32#include <OpenGl_telem.hxx>
33#include <OpenGl_telem_inquire.hxx>
34
35/*----------------------------------------------------------------------*/
36
37static TStatus DoTextureMapMethodAdd( TSM_ELEM_DATA, Tint, cmn_key* );
38static TStatus DoTextureMapMethodDisplay( TSM_ELEM_DATA, Tint, cmn_key* );
39static TStatus DoTextureMapMethodPrint( TSM_ELEM_DATA, Tint, cmn_key* );
40static TStatus DoTextureMapMethodInquire( TSM_ELEM_DATA, Tint, cmn_key* );
41
42static TStatus (*MtdTbl[])( TSM_ELEM_DATA, Tint, cmn_key* ) =
43{
44 0, /* PickTraverse */
45 DoTextureMapMethodDisplay,
46 DoTextureMapMethodAdd,
47 0, /* Delete */
48 DoTextureMapMethodPrint,
49 DoTextureMapMethodInquire
50};
51
52
53MtblPtr
54TelDoTextureMapInitClass( TelType *el )
55{
56 *el = TelDoTextureMap;
57 return MtdTbl;
58}
59
60static TStatus
61DoTextureMapMethodAdd( TSM_ELEM_DATA d, Tint n, cmn_key *k )
62{
63 ((tsm_elem_data)(d.pdata))->ldata = k[0]->data.ldata;
64
65 return TSuccess;
66}
67
68
69static TStatus
70DoTextureMapMethodDisplay( TSM_ELEM_DATA d, Tint n, cmn_key *k )
71{
72 CMN_KEY key;
73
74 key.id = TelDoTextureMap;
75 key.data.ldata = d.ldata;
76 TsmSetAttri( 1, &key );
77 return TSuccess;
78}
79
80
81static TStatus
82DoTextureMapMethodPrint( TSM_ELEM_DATA data, Tint n, cmn_key *k )
83{
84 switch( data.ldata )
85 {
86 case TEL_SD_SHADING:
87 fprintf( stdout, "TelDoTextureMap. Value = TEL_SD_SHADING\n" );
88 break;
89
90 case TEL_SD_TEXTURE:
91 fprintf( stdout, "TelDoTextureMap. Value = TEL_SD_TEXTURE\n" );
92 break;
93 }
94
95 fprintf( stdout, "\n" );
96
97 return TSuccess;
98}
99
100
101static TStatus
102DoTextureMapMethodInquire( TSM_ELEM_DATA data, Tint n, cmn_key *k )
103{
104 Tint i;
105
106 for( i = 0; i < n; i++ )
107 {
108 switch( k[i]->id )
109 {
110 case INQ_GET_SIZE_ID:
111 {
112 k[i]->data.ldata = sizeof( Tint );
113 break;
114 }
115 case INQ_GET_CONTENT_ID:
116 {
117 TEL_INQ_CONTENT *c;
118 Teldata *w;
119
120 c = (tel_inq_content)k[i]->data.pdata;
121 w = c->data;
122 c->act_size = 0;
123 w->idata = data.ldata;
124 break;
125 }
126 }
127 }
128
129 return TSuccess;
130}