Skip to content

Commit

Permalink
Add a note that the example is written in old style
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikolaj committed Jun 15, 2020
1 parent 6349232 commit e87d237
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ A small example executable is included with the library. It loads a given font
and uses it to display text in various ways. You can find it in the `example`
directory.

Note: this example works, but is written in sdl1-style, so instead
you should change surfaces to textures and follow the usual sdl2 API.

```bash
cd sdl2-ttf
cabal configure -fexample
Expand Down
5 changes: 5 additions & 0 deletions example/Example.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
-- Note: this code uses the old, inherited from sdl1, surface-based
-- API for displaying on screen. It can't be used together with the new
-- renderer API. You should instead copy the surface to a texture ASAP
-- and then display the texture using the renderer in the usual
-- sdl2 way.
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}

Expand Down

0 comments on commit e87d237

Please sign in to comment.