comparison modules/sdl.tp @ 333:577406b25f89

Added binding for SDL_SetTextureColorMod and SDL_GetTextureColorMod and updated the Freetype sample to use it for setting the color of text
author Michael Pavone <pavone@retrodev.com>
date Sun, 29 Mar 2015 09:43:24 -0700
parents ead24192ed45
children 98534108b854
comparison
equal deleted inserted replaced
332:ead24192ed45 333:577406b25f89
587 } 587 }
588 588
589 llMessage: blendMode withVars: { 589 llMessage: blendMode withVars: {
590 mode <- obj_uint32 ptr 590 mode <- obj_uint32 ptr
591 } andCode: { 591 } andCode: {
592 mode <-make_object: (addr_of: obj_uint32_meta) NULL 0 592 mode <- make_object: (addr_of: obj_uint32_meta) NULL 0
593 SDL_GetTextureBlendMode: texture (addr_of: (mode num)) 593 SDL_GetTextureBlendMode: texture (addr_of: (mode num))
594 mode 594 mode
595 }
596
597 llMessage: colorMod! withVars: {
598 color <- object ptr
599 tmp <- object ptr
600 r <- obj_uint8 ptr
601 g <- obj_uint8 ptr
602 b <- obj_uint8 ptr
603 intret <- obj_int32 ptr
604 } andCode: :color {
605 tmp <- mcall: r 1 color
606 r <- (mcall: uint8 1 tmp) castTo: (obj_uint8 ptr)
607 tmp <- mcall: g 1 color
608 g <- (mcall: uint8 1 tmp) castTo: (obj_uint8 ptr)
609 tmp <- mcall: b 1 color
610 b <- (mcall: uint8 1 tmp) castTo: (obj_uint8 ptr)
611 intret <- make_object: (addr_of: obj_int32_meta) NULL 0
612 intret num!: (SDL_SetTextureColorMod: texture (r num) (g num) (b num))
613 intret
614 }
615
616 llMessage: colorMod withVars: {
617 color <- object ptr
618 r <- obj_uint8 ptr
619 g <- obj_uint8 ptr
620 b <- obj_uint8 ptr
621 rescode <- int32_t
622 } andCode: {
623 r <- make_object: (addr_of: obj_uint8_meta) NULL 0
624 g <- make_object: (addr_of: obj_uint8_meta) NULL 0
625 b <- make_object: (addr_of: obj_uint8_meta) NULL 0
626 rescode <- SDL_GetTextureColorMod: texture (addr_of: (r num)) (addr_of: (g num)) (addr_of: (b num))
627 if: rescode {
628 mcall: none 1 option
629 } else: {
630 mcall: value 2 option (mcall: r:g:b 4 sdl r g b)
631 }
595 } 632 }
596 633
597 llMessage: destroy withVars: {} andCode: { 634 llMessage: destroy withVars: {} andCode: {
598 SDL_DestroyTexture: texture 635 SDL_DestroyTexture: texture
599 true 636 true