fix(Lab_2): White screen after selecting file

Fix problem with white screeen after selected file
This commit is contained in:
Kirill 2025-05-04 16:42:10 +03:00
parent f18d6f1025
commit 16cfa6744d
3 changed files with 8 additions and 11 deletions

View File

@ -3,15 +3,12 @@ package org.exampl
import java.io.File
import java.nio.ByteBuffer
import java.nio.ByteOrder
import java.nio.ShortBuffer
class Bin {
companion object {
object Bin {
var X = 0
var Y = 0
var Z = 0
lateinit var array: ShortArray
}
fun readBIN(path: String) {
if (File(path).exists()) {

View File

@ -8,7 +8,7 @@ import javax.swing.filechooser.FileNameExtensionFilter
class Form1 {
private var loaded = false
var currentLayer = 0
private val bin = Bin()
private val bin = Bin
val view = View()
private var minTF = -3000
@ -35,6 +35,7 @@ class Form1 {
bin.readBIN(file.absolutePath)
view.setupView(800, 600) // Установите размеры окна
loaded = true
view.needReload = true // Убедимся, что текстура загружается сразу после выбора файла
}
}

View File

@ -1,7 +1,6 @@
package org.exampl
import org.lwjgl.opengl.GL11.*
import java.awt.Color
import java.awt.image.BufferedImage
import java.nio.ByteBuffer