Rev 6108 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6108 | Rev 6523 | ||
---|---|---|---|
Line 21... | Line 21... | ||
21 | mov [ysize],ecx |
21 | mov [ysize],ecx |
22 | 22 | ||
Line 23... | Line 23... | ||
23 | ; we may need to resize the zbuffer |
23 | ; we may need to resize the zbuffer |
Line 24... | Line 24... | ||
24 | 24 | ||
25 | cmp dword[edx+offs_cont_viewport+offs_vpor_ysize],ecx |
25 | cmp dword[edx+GLContext.viewport+offs_vpor_ysize],ecx |
26 | jne @f |
26 | jne @f |
27 | mov ecx,[xmin] |
27 | mov ecx,[xmin] |
28 | cmp dword[edx+offs_cont_viewport+offs_vpor_xmin],ecx |
28 | cmp dword[edx+GLContext.viewport+offs_vpor_xmin],ecx |
29 | jne @f |
29 | jne @f |
30 | mov ecx,[ymin] |
30 | mov ecx,[ymin] |
31 | cmp dword[edx+offs_cont_viewport+offs_vpor_ymin],ecx |
31 | cmp dword[edx+GLContext.viewport+offs_vpor_ymin],ecx |
32 | jne @f |
32 | jne @f |
33 | mov ecx,[xsize] |
33 | mov ecx,[xsize] |
34 | cmp dword[edx+offs_cont_viewport+offs_vpor_xsize],ecx |
34 | cmp dword[edx+GLContext.viewport+offs_vpor_xsize],ecx |
35 | jne @f |
35 | jne @f |
36 | jmp .end_f |
36 | jmp .end_f |
Line 37... | Line 37... | ||
37 | @@: |
37 | @@: |
Line 42... | Line 42... | ||
42 | mov ecx,[ymin] |
42 | mov ecx,[ymin] |
43 | add ecx,[ysize] |
43 | add ecx,[ysize] |
44 | mov [ysize_req],ecx ;ysize_req = ymin + ysize |
44 | mov [ysize_req],ecx ;ysize_req = ymin + ysize |
45 | 45 | ||
Line 46... | Line 46... | ||
46 | cmp dword[edx+offs_cont_gl_resize_viewport],0 |
46 | cmp dword[edx+GLContext.gl_resize_viewport],0 |
47 | je @f |
47 | je @f |
48 | mov eax,ebp |
48 | mov eax,ebp |
49 | sub eax,4 |
49 | sub eax,4 |
50 | push eax |
50 | push eax |
51 | sub eax,4 |
51 | sub eax,4 |
52 | push eax |
52 | push eax |
53 | stdcall dword[edx+offs_cont_gl_resize_viewport], edx ;gl_resize_viewport(context,&xsize_req,&ysize_req) |
53 | stdcall dword[edx+GLContext.gl_resize_viewport], edx ;gl_resize_viewport(context,&xsize_req,&ysize_req) |
54 | cmp eax,0 |
54 | cmp eax,0 |
55 | je @f |
55 | je @f |
56 | stdcall dbg_print,sz_glViewport,err_4 |
56 | stdcall dbg_print,sz_glViewport,err_4 |
57 | @@: |
57 | @@: |
Line 68... | Line 68... | ||
68 | jg @f |
68 | jg @f |
69 | stdcall dbg_print,sz_glViewport,err_5 |
69 | stdcall dbg_print,sz_glViewport,err_5 |
70 | @@: |
70 | @@: |
71 | mov ecx,[xmin] |
71 | mov ecx,[xmin] |
72 | mov dword[edx+offs_cont_viewport+offs_vpor_xmin],ecx |
72 | mov dword[edx+GLContext.viewport+offs_vpor_xmin],ecx |
73 | mov ecx,[ymin] |
73 | mov ecx,[ymin] |
74 | mov dword[edx+offs_cont_viewport+offs_vpor_ymin],ecx |
74 | mov dword[edx+GLContext.viewport+offs_vpor_ymin],ecx |
75 | mov ecx,[xsize] |
75 | mov ecx,[xsize] |
76 | mov dword[edx+offs_cont_viewport+offs_vpor_xsize],ecx |
76 | mov dword[edx+GLContext.viewport+offs_vpor_xsize],ecx |
77 | mov ecx,[ysize] |
77 | mov ecx,[ysize] |
78 | mov dword[edx+offs_cont_viewport+offs_vpor_ysize],ecx |
78 | mov dword[edx+GLContext.viewport+offs_vpor_ysize],ecx |
79 | 79 | ||
Line 80... | Line 80... | ||
80 | mov dword[edx+offs_cont_viewport+offs_vpor_updated],1 |
80 | mov dword[edx+GLContext.viewport+offs_vpor_updated],1 |
81 | .end_f: |
81 | .end_f: |
82 | ret |
82 | ret |
83 | endp |
83 | endp |
Line 84... | Line 84... | ||
84 | 84 | ||
Line 90... | Line 90... | ||
90 | mov ebx,[ebx+4] |
90 | mov ebx,[ebx+4] |
91 | 91 | ||
Line 92... | Line 92... | ||
92 | cmp ebx,GL_CULL_FACE |
92 | cmp ebx,GL_CULL_FACE |
93 | jne @f |
93 | jne @f |
94 | mov [eax+offs_cont_cull_face_enabled],ecx |
94 | mov [eax+GLContext.cull_face_enabled],ecx |
95 | jmp .end_f |
95 | jmp .end_f |
96 | @@: |
96 | @@: |
97 | cmp ebx,GL_LIGHTING |
97 | cmp ebx,GL_LIGHTING |
98 | jne @f |
98 | jne @f |
99 | mov [eax+offs_cont_lighting_enabled],ecx |
99 | mov [eax+GLContext.lighting_enabled],ecx |
100 | jmp .end_f |
100 | jmp .end_f |
101 | @@: |
101 | @@: |
102 | cmp ebx,GL_COLOR_MATERIAL |
102 | cmp ebx,GL_COLOR_MATERIAL |
103 | jne @f |
103 | jne @f |
104 | mov [eax+offs_cont_color_material_enabled],ecx |
104 | mov [eax+GLContext.color_material_enabled],ecx |
105 | jmp .end_f |
105 | jmp .end_f |
106 | @@: |
106 | @@: |
107 | cmp ebx,GL_TEXTURE_2D |
107 | cmp ebx,GL_TEXTURE_2D |
108 | jne @f |
108 | jne @f |
109 | mov [eax+offs_cont_texture_2d_enabled],ecx |
109 | mov [eax+GLContext.texture_2d_enabled],ecx |
110 | jmp .end_f |
110 | jmp .end_f |
111 | @@: |
111 | @@: |
112 | cmp ebx,GL_NORMALIZE |
112 | cmp ebx,GL_NORMALIZE |
113 | jne @f |
113 | jne @f |
114 | mov [eax+offs_cont_normalize_enabled],ecx |
114 | mov [eax+GLContext.normalize_enabled],ecx |
115 | jmp .end_f |
115 | jmp .end_f |
116 | @@: |
116 | @@: |
117 | cmp ebx,GL_DEPTH_TEST |
117 | cmp ebx,GL_DEPTH_TEST |
118 | jne @f |
118 | jne @f |
119 | mov [eax+offs_cont_depth_test],ecx |
119 | mov [eax+GLContext.depth_test],ecx |
120 | jmp .end_f |
120 | jmp .end_f |
121 | @@: |
121 | @@: |
122 | cmp ebx,GL_POLYGON_OFFSET_FILL |
122 | cmp ebx,GL_POLYGON_OFFSET_FILL |
123 | jne .polygon_offset_fill |
123 | jne .polygon_offset_fill |
124 | cmp ecx,0 |
124 | cmp ecx,0 |
125 | je @f |
125 | je @f |
126 | or dword[eax+offs_cont_offset_states],TGL_OFFSET_FILL |
126 | or dword[eax+GLContext.offset_states],TGL_OFFSET_FILL |
127 | jmp .end_f |
127 | jmp .end_f |
128 | @@: |
128 | @@: |
129 | and dword[eax+offs_cont_offset_states],not TGL_OFFSET_FILL |
129 | and dword[eax+GLContext.offset_states],not TGL_OFFSET_FILL |
130 | jmp .end_f |
130 | jmp .end_f |
131 | .polygon_offset_fill: |
131 | .polygon_offset_fill: |
132 | cmp ebx,GL_POLYGON_OFFSET_POINT |
132 | cmp ebx,GL_POLYGON_OFFSET_POINT |
133 | jne .polygon_offset_point |
133 | jne .polygon_offset_point |
134 | cmp ecx,0 |
134 | cmp ecx,0 |
135 | je @f |
135 | je @f |
136 | or dword[eax+offs_cont_offset_states],TGL_OFFSET_POINT |
136 | or dword[eax+GLContext.offset_states],TGL_OFFSET_POINT |
137 | jmp .end_f |
137 | jmp .end_f |
138 | @@: |
138 | @@: |
139 | and dword[eax+offs_cont_offset_states],not TGL_OFFSET_POINT |
139 | and dword[eax+GLContext.offset_states],not TGL_OFFSET_POINT |
140 | jmp .end_f |
140 | jmp .end_f |
141 | .polygon_offset_point: |
141 | .polygon_offset_point: |
142 | cmp ebx,GL_POLYGON_OFFSET_LINE |
142 | cmp ebx,GL_POLYGON_OFFSET_LINE |
143 | jne .polygon_offset_line |
143 | jne .polygon_offset_line |
144 | cmp ecx,0 |
144 | cmp ecx,0 |
145 | je @f |
145 | je @f |
146 | or dword[eax+offs_cont_offset_states],TGL_OFFSET_LINE |
146 | or dword[eax+GLContext.offset_states],TGL_OFFSET_LINE |
147 | jmp .end_f |
147 | jmp .end_f |
148 | @@: |
148 | @@: |
149 | and dword[eax+offs_cont_offset_states],not TGL_OFFSET_LINE |
149 | and dword[eax+GLContext.offset_states],not TGL_OFFSET_LINE |
150 | jmp .end_f |
150 | jmp .end_f |
151 | .polygon_offset_line: ;default: |
151 | .polygon_offset_line: ;default: |
152 | cmp ebx,GL_LIGHT0 |
152 | cmp ebx,GL_LIGHT0 |
153 | jl .els_0 |
153 | jl .els_0 |
154 | cmp ebx,GL_LIGHT0+MAX_LIGHTS |
154 | cmp ebx,GL_LIGHT0+MAX_LIGHTS |
155 | jge .els_0 ;if (GL_LIGHT0 <= ebx < GL_LIGHT0+MAX_LIGHTS) |
155 | jge .els_0 ;if (GL_LIGHT0 <= ebx < GL_LIGHT0+MAX_LIGHTS) |
156 | sub ebx,GL_LIGHT0 |
156 | sub ebx,GL_LIGHT0 |
157 | stdcall gl_enable_disable_light, eax,ebx,ecx |
157 | stdcall gl_enable_disable_light, eax,ebx,ecx |
158 | jmp .end_f |
158 | jmp .end_f |
159 | .els_0: |
159 | .els_0: |
160 | ;//fprintf(stderr,"glEnableDisable: 0x%X not supported.\n",code); |
160 | ;fprintf(stderr,"glEnableDisable: 0x%X not supported.\n",code); |
161 | .end_f: |
161 | .end_f: |
162 | ret |
162 | ret |
163 | endp |
163 | endp |
Line 164... | Line 164... | ||
164 | 164 | ||
165 | align 4 |
165 | align 4 |
166 | proc glopShadeModel uses eax ebx, context:dword,p:dword |
166 | proc glopShadeModel uses eax ebx, context:dword,p:dword |
167 | mov eax,[context] |
167 | mov eax,[context] |
168 | mov ebx,[p] |
168 | mov ebx,[p] |
169 | mov ebx,[ebx+4] |
169 | mov ebx,[ebx+4] |
170 | mov [eax+offs_cont_current_shade_model],ebx |
170 | mov [eax+GLContext.current_shade_model],ebx |
171 | ret |
171 | ret |
Line 172... | Line 172... | ||
172 | endp |
172 | endp |
173 | 173 | ||
174 | align 4 |
174 | align 4 |
175 | proc glopCullFace uses eax ebx, context:dword,p:dword |
175 | proc glopCullFace uses eax ebx, context:dword,p:dword |
176 | mov eax,[context] |
176 | mov eax,[context] |
177 | mov ebx,[p] |
177 | mov ebx,[p] |
178 | mov ebx,[ebx+4] |
178 | mov ebx,[ebx+4] |
179 | mov [eax+offs_cont_current_cull_face],ebx |
179 | mov [eax+GLContext.current_cull_face],ebx |
Line 180... | Line 180... | ||
180 | ret |
180 | ret |
181 | endp |
181 | endp |
182 | 182 | ||
183 | align 4 |
183 | align 4 |
184 | proc glopFrontFace uses eax ebx, context:dword,p:dword |
184 | proc glopFrontFace uses eax ebx, context:dword,p:dword |
185 | mov eax,[context] |
185 | mov eax,[context] |
186 | mov ebx,[p] |
186 | mov ebx,[p] |
187 | mov ebx,[ebx+4] |
187 | mov ebx,[ebx+4] |
Line 188... | Line 188... | ||
188 | mov [eax+offs_cont_current_front_face],ebx |
188 | mov [eax+GLContext.current_front_face],ebx |
189 | ret |
189 | ret |
Line 196... | Line 196... | ||
196 | 196 | ||
Line 197... | Line 197... | ||
197 | cmp dword[ebx+4],GL_BACK |
197 | cmp dword[ebx+4],GL_BACK |
198 | jne @f |
198 | jne @f |
199 | mov ebx,[ebx+8] |
199 | mov ebx,[ebx+8] |
200 | mov [eax+offs_cont_polygon_mode_back],ebx |
200 | mov [eax+GLContext.polygon_mode_back],ebx |
201 | jmp .end_f |
201 | jmp .end_f |
202 | @@: |
202 | @@: |
203 | cmp dword[ebx+4],GL_FRONT |
203 | cmp dword[ebx+4],GL_FRONT |
204 | jne @f |
204 | jne @f |
205 | mov ebx,[ebx+8] |
205 | mov ebx,[ebx+8] |
206 | mov [eax+offs_cont_polygon_mode_front],ebx |
206 | mov [eax+GLContext.polygon_mode_front],ebx |
207 | jmp .end_f |
207 | jmp .end_f |
208 | @@: |
208 | @@: |
209 | cmp dword[ebx+4],GL_FRONT_AND_BACK |
209 | cmp dword[ebx+4],GL_FRONT_AND_BACK |
210 | jne @f |
210 | jne @f |
211 | mov ebx,[ebx+8] |
211 | mov ebx,[ebx+8] |
212 | mov [eax+offs_cont_polygon_mode_front],ebx |
212 | mov [eax+GLContext.polygon_mode_front],ebx |
213 | mov [eax+offs_cont_polygon_mode_back],ebx |
213 | mov [eax+GLContext.polygon_mode_back],ebx |
214 | jmp .end_f |
214 | jmp .end_f |
215 | @@: |
215 | @@: |
216 | ; assert(0); |
216 | ; assert(0); |
217 | .end_f: |
217 | .end_f: |
218 | ret |
218 | ret |
Line 233... | Line 233... | ||
233 | proc glopPolygonOffset uses eax ebx ecx, context:dword,p:dword |
233 | proc glopPolygonOffset uses eax ebx ecx, context:dword,p:dword |
234 | mov eax,[context] |
234 | mov eax,[context] |
235 | mov ebx,[p] |
235 | mov ebx,[p] |
236 | mov ecx,[ebx+4] |
236 | mov ecx,[ebx+4] |
237 | mov [eax+offs_cont_offset_factor],ecx |
237 | mov [eax+GLContext.offset_factor],ecx |
238 | mov ecx,[ebx+8] |
238 | mov ecx,[ebx+8] |
239 | mov [eax+offs_cont_offset_units],ecx |
239 | mov [eax+GLContext.offset_units],ecx |
240 | ret |
240 | ret |
241 | endp>=> |
241 | endp>=> |
242 | 242 | ||
243 | 243 |