MacOS 14.0
Julia 1.9.3
SimpleDirectMediaLayer v0.4.0
When I draw a rectangle outline, it's fill with random stuff. In the code below, I draw a dark blue/green filled rectangle followed by a yellow outline.
Another example:
and another example, where I commented-out the lines that draw the filled blue/green rectangle:
using SimpleDirectMediaLayer
using SimpleDirectMediaLayer.LibSDL2
# Minimum code to demonstrate border error when drawing rectangles.
@assert SDL_Init(SDL_INIT_EVERYTHING) == 0 "error initializing SDL: $(unsafe_string(SDL_GetError()))"
win = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1000, 1000, SDL_WINDOW_SHOWN)
SDL_SetWindowResizable(win, SDL_TRUE)
renderer = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC)
#SDL_RenderClear(renderer) # this clears the background to the current color
# SDL_RenderPresent(renderer);
SDL_PumpEvents()
mRect = SDL_Rect(250, 150, 200, 200) # wacky Julia struct constructor; x,y, widht, height; Ref() gives us the pointer
SDL_SetRenderDrawColor(renderer, 0, 127, 127, 255);
SDL_RenderFillRect( renderer, Ref{SDL_Rect}(mRect)) # that addition mess lets me send the rect as a pointer to the rect
SDL_SetRenderDrawColor(renderer, 255, 255, 0, 255) # Yellow outline
SDL_RenderDrawRect( renderer, Ref{SDL_Rect}(mRect)) # draw outline rectangle
SDL_RenderPresent(renderer);
SDL_PumpEvents()
SDL_Delay(10000)
exit()
MacOS 14.0 Julia 1.9.3 SimpleDirectMediaLayer v0.4.0
When I draw a rectangle outline, it's fill with random stuff. In the code below, I draw a dark blue/green filled rectangle followed by a yellow outline.
Another example:
and another example, where I commented-out the lines that draw the filled blue/green rectangle: