Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The examples are stale #54

Closed
deepfire opened this issue May 17, 2015 · 10 comments
Closed

The examples are stale #54

deepfire opened this issue May 17, 2015 · 10 comments

Comments

@deepfire
Copy link
Contributor

For example (after fixing import SDL):

[nix-shell:~/src/sdl2/examples/lazyfoo]$ ghc --make Lesson43.hs
[1 of 1] Compiling Lazyfoo.Lesson43 ( Lesson43.hs, Lesson43.o )
Lesson43.hs:23:43:
    Not in scope: type constructor or class ‘SDL.TextureAccess’
Lesson43.hs:23:67:
    Ambiguous occurrence ‘Texture’
    It could refer to either ‘Lazyfoo.Lesson43.Texture’,
                             defined at Lesson43.hs:21:1
                          or ‘SDL.Texture’,
                             imported from ‘Graphics.UI.SDL’ at Lesson43.hs:15:1-22
                             (and originally defined in ‘Graphics.UI.SDL.Types’)
Lesson43.hs:24:59: Not in scope: data constructor ‘SDL.RGBA8888’
Lesson43.hs:26:34:
    Ambiguous occurrence ‘Texture’
    It could refer to either ‘Lazyfoo.Lesson43.Texture’,
                             defined at Lesson43.hs:21:1
                          or ‘SDL.Texture’,
                             imported from ‘Graphics.UI.SDL’ at Lesson43.hs:15:1-22
                             (and originally defined in ‘Graphics.UI.SDL.Types’)
Lesson43.hs:26:45:
    Ambiguous occurrence ‘Point’
    It could refer to either ‘Linear.Affine.Point’,
                             imported from ‘Linear.Affine’ at Lesson43.hs:14:1-20
                          or ‘SDL.Point’,
                             imported from ‘Graphics.UI.SDL’ at Lesson43.hs:15:1-22
                             (and originally defined in ‘Graphics.UI.SDL.Types’)
Lesson43.hs:26:69:
    Not in scope: type constructor or class ‘SDL.Rectangle’
Lesson43.hs:26:116:
    Ambiguous occurrence ‘Point’
    It could refer to either ‘Linear.Affine.Point’,
                             imported from ‘Linear.Affine’ at Lesson43.hs:14:1-20
                          or ‘SDL.Point’,
                             imported from ‘Graphics.UI.SDL’ at Lesson43.hs:15:1-22
                             (and originally defined in ‘Graphics.UI.SDL.Types’)

Lesson43.hs:29:23: Not in scope: data constructor ‘SDL.Rectangle’

Lesson43.hs:33:30: Not in scope: data constructor ‘SDL.Rectangle’

Lesson43.hs:38:44:
    Ambiguous occurrence ‘Texture’
    It could refer to either ‘Lazyfoo.Lesson43.Texture’,
                             defined at Lesson43.hs:21:1
                          or ‘SDL.Texture’,
                             imported from ‘Graphics.UI.SDL’ at Lesson43.hs:15:1-22
                             (and originally defined in ‘Graphics.UI.SDL.Types’)

Lesson43.hs:44:3: Not in scope: ‘SDL.initialize’

Lesson43.hs:44:19: Not in scope: data constructor ‘SDL.InitVideo’

Lesson43.hs:46:26:
    Not in scope: data constructor ‘SDL.HintRenderScaleQuality’

Lesson43.hs:46:53: Not in scope: data constructor ‘SDL.ScaleLinear’

Lesson43.hs:53:7: Not in scope: ‘SDL.defaultWindow’

Lesson43.hs:53:26:
    ‘SDL.windowSize’ is not a (visible) constructor field name

Lesson43.hs:60:8:
    Not in scope: data constructor ‘SDL.RendererConfig’
    Perhaps you meant ‘SDL.RendererInfo’ (imported from Graphics.UI.SDL)

Lesson43.hs:61:12:
    ‘SDL.rendererAccelerated’ is not a (visible) constructor field name

Lesson43.hs:62:12:
    ‘SDL.rendererSoftware’ is not a (visible) constructor field name

Lesson43.hs:63:12:
    ‘SDL.rendererTargetTexture’ is not a (visible) constructor field name

Lesson43.hs:64:12:
    ‘SDL.rendererPresentVSync’ is not a (visible) constructor field name

Lesson43.hs:69:71:
    Not in scope: data constructor ‘SDL.TextureAccessTarget’

Lesson43.hs:81:21: Not in scope: ‘SDL.eventPayload’

Lesson43.hs:90:43: Not in scope: data constructor ‘SDL.Rectangle’

Lesson43.hs:94:36: Not in scope: data constructor ‘SDL.Rectangle’
@deepfire
Copy link
Contributor Author

Stale, as in -- they don't represent the version of the API released on Hackage.

@polarina
Copy link
Member

The API released on Hackage is older than found in the new-api branch, and they are written against that branch.

@zudov
Copy link

zudov commented May 18, 2015

@deepfire I've been using sdl2 recently and I found that new-api version is much better than the old one on hackage. Give it a try. I personally didn't had any problems, although I only used a small subset.

@ivanperez-keera
Copy link

There seem to exist three parallel efforts at developing SDL2 bindings. This may be off-topic but, what was wrong with hsSDL2?

@ocharles
Copy link
Member

hsSDL2 was building its own FFI bindings, but @polarina beat us to that and it didn't make sense to re-invent that work. We also felt that it would be better to just have a single sdl2 package with everything you'd need, so we moved over to here.

@ivanperez-keera
Copy link

By beat us you mean "these bindings cover more", or @polarina released to hackage before you did?

For what is worth, Magic Cookies uses hsSDL2, and so do the breakout for Android and the graphic adventure.

In my opinion, it's best to have several packages (image, mixer, etc.). Each one takes some space, and not all are required for every game. On PC it may not matter, but it does on Android.

@ocharles
Copy link
Member

@ivanperez-keera I mean both. We are not trying to package the extensions to SDL2, but we do want to provide low-level bindings and high-level bindings in the same library. Splitting them doesn't really buy us much (other than maybe shedding some dependencies, but we've agreed to deal with that if people can demonstrate it's a problem).

@ivanperez-keera
Copy link

It's going to be very difficult to gather "proof" until I recompile a game with the new API. That may take a substantial amount of time :( Unfortunately, we realised that space was becoming a problem quite late in the development process. We were hoping that the compiler would remove unused code, but that's not the case with the Android backend because the regions in the object files are not fine grained enough.

This is obviously not meant to influence any decision at this point (plus the library is yours), and probably this thread is not the place either. Maybe it would be a good idea to have a mailing list for all things game development in Haskell (if there isn't one already).

@ocharles
Copy link
Member

All we have right now is the #haskell-game IRC channel on FreeNode, which you're welcome to join :)

@akhra
Copy link
Collaborator

akhra commented May 18, 2015

Not quite all -- I started /r/haskellgamedev some months back, and would be
happy to host this sort of discussion there. Beats the hell out of IRC for
archiving, and IMO much more accessible than a mailing list.

On Mon, May 18, 2015 at 1:14 PM, Oliver Charles notifications@github.com
wrote:

All we have right now is the #haskell-game IRC channel on FreeNode, which
you're welcome to join :)


Reply to this email directly or view it on GitHub
#54 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants