<commit_before>package org.macrogl.examples.backend.lwjgl

import org.lwjgl.opengl._
import org.macrogl.Macrogl
import org.macrogl.examples.backend.common._
import org.macrogl.examples.backend.common.BasicTriangle

object LwjglExamples {
  def main(args: Array[String]): Unit = {
    if (args.length > 0) {
      macroGLTest(args(0))
    } else {
      println("Use one of the following values as parameter:")
      println("\t[1] For basic triangle rendering")
      println("\t[2] For basic texturing")
      println("\t[3] For basic 3D projection and animation")
      println("\t[4] For basic 3D fractale")
      println("\t[5] For basic render-to-texture")
    }
  }

  def macroGLTest(exampleName: String): Unit = {
    val width = 640
    val height = 360
    
    def myPrint(msg: String) = println(msg)
    def myUpdate(): Boolean = {
      Display.update()
      !Display.isCloseRequested()
    }
    def myInit(): Macrogl = {
      val contextAttributes = new ContextAttribs(2, 1)
      Display.setDisplayMode(new DisplayMode(width, height))
      Display.create(new PixelFormat, contextAttributes)

      Macrogl.default
    }
    def myClose(): Unit = {
      Display.destroy()
    }
    
    val example: DemoRenderable = exampleName match {
      case "1" => new BasicTriangle(width, height, myPrint, myUpdate, myInit, myClose)
      case "2" => new BasicTexture(width, height, myPrint, myUpdate, myInit, myClose)
      case "3" => new BasicProjection3D(width, height, myPrint, myUpdate, myInit, myClose)
      case "4" => new BasicFractale3D(width, height, myPrint, myUpdate, myInit, myClose)<commit_msg>Switch LWJGL demo context from OpenGL 2.1 to OpenGL 3.0<commit_after>package org.macrogl.examples.backend.lwjgl

import org.lwjgl.opengl._
import org.macrogl.Macrogl
import org.macrogl.examples.backend.common._
import org.macrogl.examples.backend.common.BasicTriangle

object LwjglExamples {
  def main(args: Array[String]): Unit = {
    if (args.length > 0) {
      macroGLTest(args(0))
    } else {
      println("Use one of the following values as parameter:")
      println("\t[1] For basic triangle rendering")
      println("\t[2] For basic texturing")
      println("\t[3] For basic 3D projection and animation")
      println("\t[4] For basic 3D fractale")
      println("\t[5] For basic render-to-texture")
    }
  }

  def macroGLTest(exampleName: String): Unit = {
    val width = 640
    val height = 360
    
    def myPrint(msg: String) = println(msg)
    def myUpdate(): Boolean = {
      Display.update()
      !Display.isCloseRequested()
    }
    def myInit(): Macrogl = {
      val contextAttributes = new ContextAttribs(3, 0)
      Display.setDisplayMode(new DisplayMode(width, height))
      Display.create(new PixelFormat, contextAttributes)

      Macrogl.default
    }
    def myClose(): Unit = {
      Display.destroy()
    }
    
    val example: DemoRenderable = exampleName match {
      case "1" => new BasicTriangle(width, height, myPrint, myUpdate, myInit, myClose)
      case "2" => new BasicTexture(width, height, myPrint, myUpdate, myInit, myClose)
      case "3" => new BasicProjection3D(width, height, myPrint, myUpdate, myInit, myClose)
      case "4" => new BasicFractale3D(width, height, myPrint, myUpdate, myInit, myClose)
{'fraction_non_alphanumeric': 0.11639244363193176, 'fraction_numerical': 0.015234613040828763, 'mean_word_length': 3.3083989501312336, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3637963', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1026, 'n_words': 274}