How to resolve the algorithm Draw a pixel step by step in the Odin programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Draw a pixel step by step in the Odin programming language

Table of Contents

Problem Statement

Create a window and draw a pixel in it, subject to the following:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Draw a pixel step by step in the Odin programming language

Source code in the odin programming language

package main

import "vendor:sdl2"

main :: proc() {
  using sdl2

  window: ^Window = ---
  renderer: ^Renderer = ---
  event: Event = ---

  Init(INIT_VIDEO)
  CreateWindowAndRenderer(
    640, 480,
    WINDOW_SHOWN,
    &window, &renderer
  )

  SetWindowTitle(window, "Empty window")
  SetRenderDrawColor(renderer, 50, 255, 100, 255)
  RenderDrawPoint(renderer, 100, 100)
  RenderPresent(renderer)

  for event.type != .QUIT {
    Delay(10)
    PollEvent(&event)
  }

  DestroyRenderer(renderer)
  DestroyWindow(window)
  Quit()
}


  

You may also check:How to resolve the algorithm Loops/Foreach step by step in the Io programming language
You may also check:How to resolve the algorithm Peano curve step by step in the Raku programming language
You may also check:How to resolve the algorithm Arithmetic/Complex step by step in the jq programming language
You may also check:How to resolve the algorithm Compare a list of strings step by step in the Common Lisp programming language
You may also check:How to resolve the algorithm Super-d numbers step by step in the Phix programming language