Ooops
September 17, 2021, 12:00:13

Author Topic: SDL mky.mojo2  (Read 171 times)

Offline wombats

  • Jr. Member
  • **
  • Posts: 59
SDL mky.mojo2
« on: September 07, 2021, 18:21:04 »
Hi,

I'm trying to find a way to change the window title after it's created. SDL lets you do this with Max2D, but I can't figure out the way to do it with mojo2...if it's even possible.

I know this example doesn't work anyway. I don't know for sure mojo2 and SDL are even compatible.
Code: [Select]
SuperStrict
Framework mky.mojo2
Import sdl.glsdlgraphics
'Import brl.GLGraphics
Import brl.pngloader

Graphics(640, 480, 0)

Local window:TSDLWindow = TSDLGLContext.GetCurrentWindow()
window.SetTitle("Hello World")

Local canvas:TCanvas = New TCanvas.CreateCanvas()

Repeat
canvas.SetScissor(0, 0, GraphicsWidth(), GraphicsHeight())
canvas.Clear(0, 0, 0)
canvas.DrawRect(10, 10, 100, 100)
canvas.Flush()
Flip
Until KeyHit(KEY_ESCAPE) Or AppTerminate()

End

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal