0022792: Globally defined symbol PI conflicts with VTK definition (Intel compiler)
[occt.git] / src / OpenGl / OpenGl_texture.cxx
CommitLineData
7fd59977 1/***********************************************************************
2
3FONCTION :
4----------
5File OpenGl_texture.c :
6
7
8REMARQUES:
9----------
10
11
12HISTORIQUE DES MODIFICATIONS :
13--------------------------------
1405-08-97 : PCT ; Support texture mapping
15
16************************************************************************/
17
18/*----------------------------------------------------------------------*/
19/*
20* Includes
21*/
22
23#include <OpenGl_tgl_all.hxx>
24
25#include <stddef.h>
26#include <stdio.h>
27#include <GL/gl.h>
28#include <GL/glu.h>
29
30#include <OpenGl_cmn_varargs.hxx>
31#include <OpenGl_telem_attri.hxx>
32#include <OpenGl_tsm.hxx>
33#include <OpenGl_telem.hxx>
34#include <OpenGl_telem_inquire.hxx>
35#include <OpenGl_Memory.hxx>
36
37static TStatus TextureIdMethodAdd( TSM_ELEM_DATA, Tint, cmn_key* );
38static TStatus TextureIdMethodDisplay( TSM_ELEM_DATA, Tint, cmn_key* );
39static TStatus TextureIdMethodPrint( TSM_ELEM_DATA, Tint, cmn_key* );
40static TStatus TextureIdMethodInquire( TSM_ELEM_DATA, Tint, cmn_key* );
41
42static TStatus (*MtdTbl[])( TSM_ELEM_DATA, Tint, cmn_key* ) =
43{
44 0, /* PickTraverse */
45 TextureIdMethodDisplay,
46 TextureIdMethodAdd,
47 0, /* Delete */
48 TextureIdMethodPrint,
49 TextureIdMethodInquire
50};
51
52
53MtblPtr
54TelTextureIdInitClass( TelType *el )
55{
56 *el = TelTextureId;
57 return MtdTbl;
58}
59
60static TStatus
61TextureIdMethodAdd( 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
70TextureIdMethodDisplay( TSM_ELEM_DATA d, Tint n, cmn_key *k )
71{
72 CMN_KEY key;
73
74 key.id = TelTextureId;
75 key.data.ldata = d.ldata;
76 TsmSetAttri( 1, &key );
77 return TSuccess;
78}
79
80
81static TStatus
82TextureIdMethodPrint( TSM_ELEM_DATA data, Tint n, cmn_key *k )
83{
84
85 return TSuccess;
86}
87
88
89static TStatus
90TextureIdMethodInquire( TSM_ELEM_DATA data, Tint n, cmn_key *k )
91{
92 Tint i;
93
94 for( i = 0; i < n; i++ )
95 {
96 switch( k[i]->id )
97 {
98 case INQ_GET_SIZE_ID:
99 {
100 k[i]->data.ldata = sizeof( Tint );
101 break;
102 }
103 case INQ_GET_CONTENT_ID:
104 {
105 TEL_INQ_CONTENT *c;
106 Teldata *w;
107
108 c = (TEL_INQ_CONTENT*)k[i]->data.pdata;
109 w = c->data;
110 c->act_size = 0;
111 w->idata = data.ldata;
112 break;
113 }
114 }
115 }
116
117 return TSuccess;
118}