# Gloss SDL
This project is under development, don't expect anything to work yet
This is an experimental rebuild of gloss on top of libsdl. We may also change the rendering engine to be based on Constructive Solid Geometry (CSG) and ray tracing instead of rasterization. If this effort succeeds it will become Gloss 2.
The current Gloss library suffers from the following problems, which we try to address in this work:
1. The first version of Gloss used GLUT to manage windows, but the GLUT website itself says it has "been unsupported for 20 years". SDL is actively maintained.
2. Gloss can also use GLFW for window management, but still relies on GLUT for drawing vector text. SDL_ttf provides its own text support.
3. GLUT supports only a single vector font, while SDL_ttf can draw text using standard true type font files.
4. Once control enters the GLUT main loop it does not escape. GLUT redraws can happen on window events or at a fixed timer expiration. Redraws cannot be triggered by external events such as file or network activity. The current Gloss displayIO interface tries to hack around this limitation, but the interface still only updates static pictures once per second. Using the SDL API one can define their own main loop and trigger redraws based on arbitrary events.
5. GLUT does not support high dpi displays (like Retina displays on Mac). GLFW seems to have some support, but the Gloss authors haven't tested it yet. SDL has working and maintained high DPI display support.
6. Gloss has a variety of problems when launched from the GHCi console, ranging from crashes, low framerates, or force quit of GHCi when the window is closed. The behaviour is variable depending on the platform. The SDL event framework allows the window to be closed without quiting the host executable.
7. The Gloss picture type includes a polygon constructor, which allows polygons to be defined by a path, but there is an unchecked precondition that the polygon must be convex. Trying to defined non-convex paths results in undefined behaviour. There was a project to add triangulation support to gloss but the resulting code was deemed too complex to be merged. In the move to CSG we can present primitive triangles and rectangles as polygons and avoid general polygons.
8. The Gloss picture type includes circle and arc constructors. The rasterization code for circles and arcs is a bug farm, and still has known problems. Moving to CSG/ray tracing style rendering will allow us to draw circles and arcs at full resolution in a way that hopefully avoids rasterization bugs.
9. The Gloss interface API provides both "pure" and "IO" versions of top-level functions like "display" and "simulate". If we can separate the picture and rendering API cleanly from the window management functionality then we could provide just the "pure" interfaces for simple use-cases. We would require users to use a lower level IO based API for IO driven applications.
10. Gloss does not have sound support, and there appears to be no simple graphics/sound interface in the Haskell ecosystem. Attempts to combine separate audio libraries with gloss usually end up with latency problems, resulting in auto clicking. SDL has an integrated audio framework. We should also move generation of simple audio streams out of the domain of the GHC thread scheduler.
没有合适的资源?快使用搜索试试~ 我知道了~
无痛二维矢量图形、动画和模拟。___下载.zip
共184个文件
hs:142个
c:7个
cabal:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 61 浏览量
2023-04-16
19:44:56
上传
评论
收藏 807KB ZIP 举报
温馨提示
无痛二维矢量图形、动画和模拟。___下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
无痛二维矢量图形、动画和模拟。___下载.zip (184个子文件)
lena-101x101.bmp 30KB
Interface.c 9KB
init.c 7KB
Solver.c 6KB
Main.c 5KB
render.c 4KB
Model.c 4KB
main.c 3KB
gloss-examples.cabal 14KB
gloss.cabal 4KB
gloss-rendering.cabal 2KB
gloss-raster.cabal 1KB
gloss-algorithms.cabal 1KB
world.dat 1KB
world8.dat 100B
world4.dat 40B
.gitignore 66B
.gitignore 9B
.gitmodules 93B
Model.h 912B
main.h 665B
Solver.h 529B
Interface.h 262B
GLFW.hs 26KB
GLUT.hs 17KB
Picture.hs 14KB
ViewState.hs 14KB
Field.hs 13KB
Main.hs 11KB
Main.hs 11KB
Array.hs 11KB
Main.hs 10KB
Args.hs 10KB
Main.hs 9KB
Circle.hs 9KB
Line.hs 9KB
Solver.hs 7KB
Picture.hs 7KB
Object.hs 7KB
Types.hs 6KB
Collide.hs 6KB
Game.hs 6KB
Model.hs 6KB
Picture.hs 6KB
QuadTree.hs 5KB
Interact.hs 5KB
Extent.hs 5KB
Main.hs 5KB
World.hs 5KB
Color.hs 5KB
KDTree2d.hs 5KB
Advance.hs 5KB
Contact.hs 5KB
Idle.hs 4KB
Linear.hs 4KB
World.hs 4KB
Simulate.hs 4KB
Randomish.hs 4KB
Animate.hs 4KB
UserEvent.hs 4KB
Draw.hs 4KB
Boundary.hs 4KB
Main.hs 3KB
Main.hs 3KB
Advection.hs 3KB
Color.hs 3KB
Timing.hs 3KB
QuadTree.hs 3KB
Display.hs 3KB
RayCast.hs 3KB
Gloss.hs 3KB
Main.hs 3KB
Display.hs 3KB
Debug.hs 3KB
Main.hs 3KB
Interface.hs 3KB
Segment.hs 3KB
World.hs 3KB
Project.hs 2KB
Window.hs 2KB
Cell.hs 2KB
Main.hs 2KB
Bitmap.hs 2KB
ViewPort.hs 2KB
Common.hs 2KB
FieldElt.hs 2KB
State.hs 2KB
Trace.hs 2KB
Light.hs 2KB
Simulate.hs 2KB
Animate.hs 2KB
Rendering.hs 2KB
Game.hs 2KB
Vector.hs 2KB
Sources.hs 2KB
Config.hs 2KB
Actor.hs 2KB
State.hs 2KB
Community.hs 2KB
Vec3.hs 2KB
共 184 条
- 1
- 2
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功