0 | module Web.Internal.WebglTypes
  1 |
  2 | import JS
  3 |
  4 | %default total
  5 |
  6 |
  7 | --------------------------------------------------------------------------------
  8 | --          Enums
  9 | --------------------------------------------------------------------------------
 10 |
 11 | namespace WebGLPowerPreference
 12 |
 13 |   public export
 14 |   data WebGLPowerPreference = Default | LowPower | HighPerformance
 15 |
 16 |   public export
 17 |   Show WebGLPowerPreference where
 18 |     show Default = "default"
 19 |     show LowPower = "low-power"
 20 |     show HighPerformance = "high-performance"
 21 |
 22 |   public export
 23 |   Eq WebGLPowerPreference where
 24 |     (==) = (==) `on` show
 25 |
 26 |   public export
 27 |   Ord WebGLPowerPreference where
 28 |     compare = compare `on` show
 29 |
 30 |   public export
 31 |   read : String -> Maybe WebGLPowerPreference
 32 |   read "default" = Just Default
 33 |   read "low-power" = Just LowPower
 34 |   read "high-performance" = Just HighPerformance
 35 |   read _ = Nothing
 36 |
 37 |   export
 38 |   ToFFI WebGLPowerPreference String where
 39 |     toFFI = show
 40 |
 41 |   export
 42 |   FromFFI WebGLPowerPreference String where
 43 |     fromFFI = read
 44 |
 45 |
 46 |
 47 | --------------------------------------------------------------------------------
 48 | --          Interfaces
 49 | --------------------------------------------------------------------------------
 50 |
 51 | export data WebGL2RenderingContext : Type where [external]
 52 |
 53 | export
 54 | ToFFI WebGL2RenderingContext WebGL2RenderingContext where toFFI = id
 55 |
 56 | export
 57 | FromFFI WebGL2RenderingContext WebGL2RenderingContext where fromFFI = Just
 58 |
 59 | export
 60 | SafeCast WebGL2RenderingContext where
 61 |   safeCast = unsafeCastOnPrototypeName "WebGL2RenderingContext"
 62 |
 63 | export data WebGLActiveInfo : Type where [external]
 64 |
 65 | export
 66 | ToFFI WebGLActiveInfo WebGLActiveInfo where toFFI = id
 67 |
 68 | export
 69 | FromFFI WebGLActiveInfo WebGLActiveInfo where fromFFI = Just
 70 |
 71 | export
 72 | SafeCast WebGLActiveInfo where
 73 |   safeCast = unsafeCastOnPrototypeName "WebGLActiveInfo"
 74 |
 75 | export data WebGLBuffer : Type where [external]
 76 |
 77 | export
 78 | ToFFI WebGLBuffer WebGLBuffer where toFFI = id
 79 |
 80 | export
 81 | FromFFI WebGLBuffer WebGLBuffer where fromFFI = Just
 82 |
 83 | export
 84 | SafeCast WebGLBuffer where
 85 |   safeCast = unsafeCastOnPrototypeName "WebGLBuffer"
 86 |
 87 | export data WebGLFramebuffer : Type where [external]
 88 |
 89 | export
 90 | ToFFI WebGLFramebuffer WebGLFramebuffer where toFFI = id
 91 |
 92 | export
 93 | FromFFI WebGLFramebuffer WebGLFramebuffer where fromFFI = Just
 94 |
 95 | export
 96 | SafeCast WebGLFramebuffer where
 97 |   safeCast = unsafeCastOnPrototypeName "WebGLFramebuffer"
 98 |
 99 | export data WebGLObject : Type where [external]
100 |
101 | export
102 | ToFFI WebGLObject WebGLObject where toFFI = id
103 |
104 | export
105 | FromFFI WebGLObject WebGLObject where fromFFI = Just
106 |
107 | export
108 | SafeCast WebGLObject where
109 |   safeCast = unsafeCastOnPrototypeName "WebGLObject"
110 |
111 | export data WebGLProgram : Type where [external]
112 |
113 | export
114 | ToFFI WebGLProgram WebGLProgram where toFFI = id
115 |
116 | export
117 | FromFFI WebGLProgram WebGLProgram where fromFFI = Just
118 |
119 | export
120 | SafeCast WebGLProgram where
121 |   safeCast = unsafeCastOnPrototypeName "WebGLProgram"
122 |
123 | export data WebGLQuery : Type where [external]
124 |
125 | export
126 | ToFFI WebGLQuery WebGLQuery where toFFI = id
127 |
128 | export
129 | FromFFI WebGLQuery WebGLQuery where fromFFI = Just
130 |
131 | export
132 | SafeCast WebGLQuery where
133 |   safeCast = unsafeCastOnPrototypeName "WebGLQuery"
134 |
135 | export data WebGLRenderbuffer : Type where [external]
136 |
137 | export
138 | ToFFI WebGLRenderbuffer WebGLRenderbuffer where toFFI = id
139 |
140 | export
141 | FromFFI WebGLRenderbuffer WebGLRenderbuffer where fromFFI = Just
142 |
143 | export
144 | SafeCast WebGLRenderbuffer where
145 |   safeCast = unsafeCastOnPrototypeName "WebGLRenderbuffer"
146 |
147 | export data WebGLRenderingContext : Type where [external]
148 |
149 | export
150 | ToFFI WebGLRenderingContext WebGLRenderingContext where toFFI = id
151 |
152 | export
153 | FromFFI WebGLRenderingContext WebGLRenderingContext where fromFFI = Just
154 |
155 | export
156 | SafeCast WebGLRenderingContext where
157 |   safeCast = unsafeCastOnPrototypeName "WebGLRenderingContext"
158 |
159 | export data WebGLSampler : Type where [external]
160 |
161 | export
162 | ToFFI WebGLSampler WebGLSampler where toFFI = id
163 |
164 | export
165 | FromFFI WebGLSampler WebGLSampler where fromFFI = Just
166 |
167 | export
168 | SafeCast WebGLSampler where
169 |   safeCast = unsafeCastOnPrototypeName "WebGLSampler"
170 |
171 | export data WebGLShader : Type where [external]
172 |
173 | export
174 | ToFFI WebGLShader WebGLShader where toFFI = id
175 |
176 | export
177 | FromFFI WebGLShader WebGLShader where fromFFI = Just
178 |
179 | export
180 | SafeCast WebGLShader where
181 |   safeCast = unsafeCastOnPrototypeName "WebGLShader"
182 |
183 | export data WebGLShaderPrecisionFormat : Type where [external]
184 |
185 | export
186 | ToFFI WebGLShaderPrecisionFormat WebGLShaderPrecisionFormat where toFFI = id
187 |
188 | export
189 | FromFFI WebGLShaderPrecisionFormat WebGLShaderPrecisionFormat where fromFFI = Just
190 |
191 | export
192 | SafeCast WebGLShaderPrecisionFormat where
193 |   safeCast = unsafeCastOnPrototypeName "WebGLShaderPrecisionFormat"
194 |
195 | export data WebGLSync : Type where [external]
196 |
197 | export
198 | ToFFI WebGLSync WebGLSync where toFFI = id
199 |
200 | export
201 | FromFFI WebGLSync WebGLSync where fromFFI = Just
202 |
203 | export
204 | SafeCast WebGLSync where
205 |   safeCast = unsafeCastOnPrototypeName "WebGLSync"
206 |
207 | export data WebGLTexture : Type where [external]
208 |
209 | export
210 | ToFFI WebGLTexture WebGLTexture where toFFI = id
211 |
212 | export
213 | FromFFI WebGLTexture WebGLTexture where fromFFI = Just
214 |
215 | export
216 | SafeCast WebGLTexture where
217 |   safeCast = unsafeCastOnPrototypeName "WebGLTexture"
218 |
219 | export data WebGLTransformFeedback : Type where [external]
220 |
221 | export
222 | ToFFI WebGLTransformFeedback WebGLTransformFeedback where toFFI = id
223 |
224 | export
225 | FromFFI WebGLTransformFeedback WebGLTransformFeedback where fromFFI = Just
226 |
227 | export
228 | SafeCast WebGLTransformFeedback where
229 |   safeCast = unsafeCastOnPrototypeName "WebGLTransformFeedback"
230 |
231 | export data WebGLUniformLocation : Type where [external]
232 |
233 | export
234 | ToFFI WebGLUniformLocation WebGLUniformLocation where toFFI = id
235 |
236 | export
237 | FromFFI WebGLUniformLocation WebGLUniformLocation where fromFFI = Just
238 |
239 | export
240 | SafeCast WebGLUniformLocation where
241 |   safeCast = unsafeCastOnPrototypeName "WebGLUniformLocation"
242 |
243 | export data WebGLVertexArrayObject : Type where [external]
244 |
245 | export
246 | ToFFI WebGLVertexArrayObject WebGLVertexArrayObject where toFFI = id
247 |
248 | export
249 | FromFFI WebGLVertexArrayObject WebGLVertexArrayObject where fromFFI = Just
250 |
251 | export
252 | SafeCast WebGLVertexArrayObject where
253 |   safeCast = unsafeCastOnPrototypeName "WebGLVertexArrayObject"
254 |
255 |
256 | --------------------------------------------------------------------------------
257 | --          Dictionaries
258 | --------------------------------------------------------------------------------
259 |
260 | export data WebGLContextAttributes : Type where [external]
261 |
262 | export
263 | ToFFI WebGLContextAttributes WebGLContextAttributes where toFFI = id
264 |
265 | export
266 | FromFFI WebGLContextAttributes WebGLContextAttributes where fromFFI = Just
267 |
268 |
269 | --------------------------------------------------------------------------------
270 | --          Mixins
271 | --------------------------------------------------------------------------------
272 |
273 | export data WebGL2RenderingContextBase : Type where [external]
274 |
275 | export
276 | ToFFI WebGL2RenderingContextBase WebGL2RenderingContextBase where toFFI = id
277 |
278 | export
279 | FromFFI WebGL2RenderingContextBase WebGL2RenderingContextBase where fromFFI = Just
280 |
281 | export data WebGL2RenderingContextOverloads : Type where [external]
282 |
283 | export
284 | ToFFI WebGL2RenderingContextOverloads WebGL2RenderingContextOverloads where toFFI = id
285 |
286 | export
287 | FromFFI WebGL2RenderingContextOverloads WebGL2RenderingContextOverloads where fromFFI = Just
288 |
289 | export data WebGLRenderingContextBase : Type where [external]
290 |
291 | export
292 | ToFFI WebGLRenderingContextBase WebGLRenderingContextBase where toFFI = id
293 |
294 | export
295 | FromFFI WebGLRenderingContextBase WebGLRenderingContextBase where fromFFI = Just
296 |
297 | export data WebGLRenderingContextOverloads : Type where [external]
298 |
299 | export
300 | ToFFI WebGLRenderingContextOverloads WebGLRenderingContextOverloads where toFFI = id
301 |
302 | export
303 | FromFFI WebGLRenderingContextOverloads WebGLRenderingContextOverloads where fromFFI = Just
304 |