We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
With the following example
using SimpleDirectMediaLayer const SDL2 = SimpleDirectMediaLayer SDL2.init() win = SDL2.CreateWindow("", Int32(0), Int32(0), Int32(200), Int32(100), UInt32(SDL2.WINDOW_SHOWN) ) renderer = SDL2.CreateRenderer(win, Int32(-1), UInt32(SDL2.RENDERER_ACCELERATED | SDL2.RENDERER_PRESENTVSYNC) ) SDL2.SetRenderDrawColor(renderer, 0, 0, 0, 255) SDL2.RenderClear(renderer) SDL2.SetRenderDrawColor(renderer, 255, 255, 255, 255) # Regular format SDL2.RenderDrawLine(renderer, 50, 25, 150, 25) # Array format SDL2.RenderDrawLines(renderer, Cint.([[50; 50]; [150; 50]]), Cint(2)) # Reverted line SDL2.RenderDrawLines(renderer, Cint.([[150; 75]; [50; 75]]), Cint(2)) SDL2.RenderPresent(renderer) sleep(5) SDL2.Quit()
the right-most point get shifted a point up (-1 in y-value).
The text was updated successfully, but these errors were encountered:
using SimpleDirectMediaLayer.LibSDL2 @assert SDL_Init(SDL_INIT_EVERYTHING) == 0 "error initializing SDL: $(unsafe_string(SDL_GetError()))" win = SDL_CreateWindow("Game", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 600, 600, SDL_WINDOW_SHOWN) SDL_SetWindowResizable(win, SDL_TRUE) renderer = SDL_CreateRenderer(win, -1, 0) try close = false while !close event_ref = Ref{SDL_Event}() while Bool(SDL_PollEvent(event_ref)) evt = event_ref[] evt_ty = evt.type if evt_ty == SDL_QUIT close = true break end end SDL_SetRenderDrawColor(renderer,0,0,0,255) SDL_RenderClear(renderer) SDL_SetRenderDrawColor(renderer,255,255,255,255) SDL_RenderDrawLine(renderer, 50, 25, 150, 25) SDL_RenderDrawLines(renderer, Cint.([[50; 50]; [150; 50]]), Cint(2)) SDL_RenderDrawLines(renderer, Cint.([[150; 75]; [50; 75]]), Cint(2)) SDL_RenderPresent(renderer) SDL_Delay(1000 ÷ 60) end finally SDL_DestroyRenderer(renderer) SDL_DestroyWindow(win) SDL_Quit() end
I don't see any shifts...
Sorry, something went wrong.
No branches or pull requests
With the following example
the right-most point get shifted a point up (-1 in y-value).
The text was updated successfully, but these errors were encountered: