Jump to content

GUI Stops showing when calculations too large?

DtrollMC

Hey guys, so I'm messing around with 2D arrays and simple terrain generation algorithms. I know that the two algorithms I wrote are not very efficient, but I have gotten the results to display under certain settings. However, when I try to increase the size of the matrix I am generating / displaying, all the steps are done but the GUI just never shows up. What could be causing this?

 

The source code is only a few classes, so it won't take long to check out. Don't judge the code too much as I just refactored how the UI was structured so things are still messy. 

https://github.com/JLCarveth/Voronoi/tree/master/src/com/github/jlcarveth

Link to comment
Share on other sites

Link to post
Share on other sites

I don't know the language you're using but a general problem with GUI solutions is the program tying up the main thread so it cannot handle events, that results in a "program not responding" or the GUI not showing up.

 

Try doing the actual work in a new thread so the main thread can keep on doing the message pump.

Link to comment
Share on other sites

Link to post
Share on other sites

I will look into that. Haven't done any multi-threaded programming before. Using Kotlin

Link to comment
Share on other sites

Link to post
Share on other sites

Never heard of Kotlin before but you could always write the array into a bitmap very easily to view the terrain as a height map.

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×