mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
Use the type (Ptr Char) to express raw C strings.
This commit is contained in:
parent
9781c5f7cb
commit
3308652c75
@ -5,5 +5,5 @@
|
||||
(register copy (Fn [(Ref String)] String))
|
||||
(register count (Fn [(Ref String)] Int))
|
||||
(register duplicate (Fn [(Ref String)] String))
|
||||
(register raw (Fn [(Ref String)] String)) ;; bad name?
|
||||
(register cstr (Fn [(Ref String)] (Ptr Char)))
|
||||
)
|
||||
|
@ -137,7 +137,7 @@ string String_duplicate(string *s) {
|
||||
return strdup(*s);
|
||||
}
|
||||
|
||||
string String_raw(string *s) {
|
||||
char* String_cstr(string *s) {
|
||||
return *s;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
(system-include "SDL2/SDL_image.h")
|
||||
(add-lib "-lSDL2_image")
|
||||
|
||||
(register IMG_LoadTexture (Fn [(Ptr SDL_Renderer) String] (Ptr SDL_Texture)))
|
||||
(register IMG_Load (Fn [String] (Ptr SDL_Surface)))
|
||||
(register IMG_LoadTexture (Fn [(Ptr SDL_Renderer) (Ptr Char)] (Ptr SDL_Texture)))
|
||||
(register IMG_Load (Fn [(Ptr Char)] (Ptr SDL_Surface)))
|
||||
|
@ -79,8 +79,8 @@
|
||||
(defn main []
|
||||
(let [app (app-init (String.copy "~ CARP ~") 512 512)
|
||||
rend (app-renderer app)
|
||||
img1 (IMG_LoadTexture rend (raw "./img/square.png"))
|
||||
img2 (IMG_LoadTexture rend (raw "./img/carp_logo_969_no_texture.png"))
|
||||
img1 (IMG_LoadTexture rend (cstr "./img/square.png"))
|
||||
img2 (IMG_LoadTexture rend (cstr "./img/carp_logo_969_no_texture.png"))
|
||||
images (Images.init img1 img2)]
|
||||
(while true
|
||||
(do
|
||||
|
Loading…
Reference in New Issue
Block a user