-
Notifications
You must be signed in to change notification settings - Fork 1
/
caramia.cabal
272 lines (252 loc) · 10.3 KB
/
caramia.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
name: caramia
version: 0.7.2.2
synopsis: High-level OpenGL bindings
homepage: https://github.com/Noeda/caramia/
license: MIT
license-file: LICENSE
author: Mikko Juola
copyright: Copyright (c) 2014-2015 Mikko Juola
maintainer: mikjuo@gmail.com
category: Graphics
build-type: Simple
stability: experimental
bug-reports: https://github.com/Noeda/caramia/issues/
cabal-version: >=1.10
extra-source-files: README.md changelog.md stack.yaml
description:
This is a highish-level OpenGL bindings library for real-time graphics for
Haskell, with minimum OpenGL version being 2.1.
.
Requirements:
.
* GHC 7.8+
.
* OpenGL 2.1 (with some extensions)
.
If the target system has OpenGL 3.3, then all features in this library should
be available unless stated otherwise. OpenGL contexts with 3.x or later
versions can be a core profile; this library does not care.
.
You need to use `-threaded` flag in executables that use this library.
.
Here are the most important features of this library:
.
* Safe and automatic finalization of OpenGL resources, with optional prompt
finalization.
.
* No implicit state (that is, no glBind* mess or equivalent). There is a
monad for mass-rendering that has implicit state but the state is localized
to running of that monad. (see Caramia.Render).
.
Here are some curious features that you might find useful.
.
* This library plays nice with other OpenGL libraries. It does not mess up
the implicit OpenGL state (except for aforementioned rendering monad).
.
* This library does not create an OpenGL context. You can use whatever
library you want to create an OpenGL context as long as it can get an
OpenGL 2.1 (or any later version) context. You may be interested at looking
at the tests in this package to see how to use this with the `sdl2`
package.
.
* Operations are generalized over `MonadIO`. Works on top of pure `IO` and
also in your custom monad stacks, as long as they implement `MonadIO`.
.
(At least) the following OpenGL concepts are present in this library:
.
* Buffer objects (you can do low-level mapping and use raw pointers)
.
* Geometry, vertex and fragment shaders
.
* Indexed and non-indexed rendering
.
* Framebuffers
.
* Textures (with many topologies, 1D, 2D, 3D, texture arrays, cube textures;
we also have buffer textures and multisampling textures)
.
* Vertex array objects
.
* Blending, stencil, depth and cull tests
.
* Instanced rendering
.
* Synchronization objects
.
* Query objects
.
This library tries to avoid including obsolete or redundant features of OpenGL.
.
Note that the library is in flux and API-breaking changes tend to happen
often.
flag build-toys
default: False
description: Build some toy programs to test and play with.
flag fix-opengl21
default: False
description: Makes the library think only OpenGL 2.1 is available. This
can be useful for debugging.
source-repository head
type: git
location: https://github.com/Noeda/caramia.git
library
exposed-modules: Graphics.Caramia
Graphics.Caramia.Blend
Graphics.Caramia.Blend.Internal
Graphics.Caramia.Buffer
Graphics.Caramia.Buffer.Internal
Graphics.Caramia.Color
Graphics.Caramia.Context
Graphics.Caramia.Framebuffer
Graphics.Caramia.Framebuffer.Internal
Graphics.Caramia.ImageFormats
Graphics.Caramia.ImageFormats.Internal
Graphics.Caramia.Internal.ContextLocalData
Graphics.Caramia.Internal.Exception
Graphics.Caramia.Internal.OpenGLCApi
Graphics.Caramia.Internal.OpenGLDebug
Graphics.Caramia.Internal.OpenGLVersion
Graphics.Caramia.Internal.TexStorage
Graphics.Caramia.Memory
Graphics.Caramia.OpenGLResource
Graphics.Caramia.Prelude
Graphics.Caramia.Query
Graphics.Caramia.Render
Graphics.Caramia.Render.Internal
Graphics.Caramia.Resource
Graphics.Caramia.Shader
Graphics.Caramia.Shader.Internal
Graphics.Caramia.Sync
Graphics.Caramia.Texture
Graphics.Caramia.Texture.Internal
Graphics.Caramia.VAO
Graphics.Caramia.VAO.Internal
ghc-options: -Wall -fno-warn-name-shadowing
build-depends: base >=4.7 && <5.0.0.0
,bytestring >=0.10 && <1.0
,containers >=0.5 && <1.0
,exceptions >=0.6 && <1.0
,lens >=4.6 && <5.0
,linear >=1.18 && <2.0
,mtl >=2.1 && <3.0
,semigroups >=0.15 && <1.0
,text >=0.9 && <2.0
,transformers >=0.3 && <1.0
,vector >=0.10 && <1.0
,gl >=0.7.3 && <1.0
if flag(fix-opengl21)
cpp-options: -DFIXED_OPENGL_MAJOR_VERSION=2
-DFIXED_OPENGL_MINOR_VERSION=1
hs-source-dirs: src
default-language: Haskell2010
if os(darwin)
frameworks: OpenGL
test-suite buffer
type: exitcode-stdio-1.0
main-is: Main.hs
ghc-options: -Wall -fno-warn-name-shadowing -threaded -rtsopts -with-rtsopts=-N
hs-source-dirs: tests/buffer
build-depends: base, caramia
,containers >=0.5.5 && <1.0
,HUnit >=1.2.5.2 && <2.0
,linear >=1.18 && <2.0
,sdl2 >=1.3 && <2.0
,test-framework >=0.8.1 && <1.0
,test-framework-hunit >=0.3.0.1 && <1.0
default-language: Haskell2010
test-suite shader
type: exitcode-stdio-1.0
main-is: Main.hs
ghc-options: -Wall -fno-warn-name-shadowing -threaded -rtsopts -with-rtsopts=-N
hs-source-dirs: tests/shader
build-depends: base, caramia
,HUnit >=1.2.5.2 && <2.0
,linear >=1.18 && <2.0
,sdl2 >=1.3 && <2.0
,test-framework >=0.8.1 && <1.0
,test-framework-hunit >=0.3.0.1 && <1.0
default-language: Haskell2010
test-suite texture
type: exitcode-stdio-1.0
main-is: Main.hs
ghc-options: -Wall -fno-warn-name-shadowing -threaded -rtsopts -with-rtsopts=-N
hs-source-dirs: tests/texture
build-depends: base, caramia
,containers >=0.5.5 && <1.0
,HUnit >=1.2.5.2 && <2.0
,linear >=1.18 && <2.0
,sdl2 >=1.3 && <2.0
,test-framework >=0.8.1 && <1.0
,test-framework-hunit >=0.3.0.1 && <1.0
,transformers >=0.3 && <1.0
default-language: Haskell2010
test-suite color
type: exitcode-stdio-1.0
main-is: Main.hs
ghc-options: -Wall -fno-warn-name-shadowing -threaded -rtsopts -with-rtsopts=-N
hs-source-dirs: tests/color
build-depends: base, caramia
,linear >=1.18 && <2.0
,test-framework >=0.8.1 && <1.0
,test-framework-quickcheck2 >=0.3.0.3 && <1.0
default-language: Haskell2010
-- This is just a dumping ground test that does stupid things. It's used to
-- check if things work at all.
executable smoke-test
main-is: Main.hs
ghc-options: -Wall -fno-warn-name-shadowing -threaded -rtsopts -with-rtsopts=-N
hs-source-dirs: demos/smoke-test
if flag(build-toys)
build-depends: base, caramia
,linear >=1.18 && <2.0
,sdl2 >=1.3 && <2.0
,text >=0.9 && <2.0
else
buildable: False
default-language: Haskell2010
-- This one tests Caramia.Memory if it returns anything useful.
executable memory-info
main-is: Main.hs
ghc-options: -Wall -fno-warn-name-shadowing -threaded -rtsopts -with-rtsopts=-N
hs-source-dirs: demos/memory-info
if flag(build-toys)
build-depends: base, caramia
,sdl2 >=1.3 && <2.0
else
buildable: False
default-language: Haskell2010
-- Gets OpenGL version with two different ways to check if there is one that's consistent.
executable gl-info
main-is: Main.hs
ghc-options: -Wall -fno-warn-name-shadowing -threaded -rtsopts -with-rtsopts=-N
hs-source-dirs: demos/gl-info
if flag(build-toys)
build-depends: base, caramia
,sdl2 >=1.3 && <2.0
,OpenGLRaw >=1.5
else
buildable: False
default-language: Haskell2010
executable query-objects
main-is: Main.hs
ghc-options: -Wall -fno-warn-name-shadowing -threaded -rtsopts -with-rtsopts=-N
hs-source-dirs: demos/query-objects
if flag(build-toys)
build-depends: base, caramia
,sdl2 >=1.3 && <2.0
,text >=0.9 && <2.0
,transformers >=0.3 && <1.0
,vector >=0.10 && <1.0
else
buildable: False
default-language: Haskell2010
executable textures
main-is: Main.hs
ghc-options: -Wall -fno-warn-name-shadowing -threaded -rtsopts -with-rtsopts=-N
hs-source-dirs: demos/textures
if flag(build-toys)
build-depends: base, caramia
,sdl2 >=1.3 && <2.0
else
buildable: False
default-language: Haskell2010