I don't know, lol
This commit is contained in:
parent
9cd7646805
commit
0cf9148447
16
mm.py
16
mm.py
@ -2,8 +2,9 @@ from dateutil.parser import parse
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import sqlite3 as sql
|
import sqlite3 as sql
|
||||||
from ImguiWindow import ImguiWindow, load_texture
|
from ImguiWindow import ImguiWindow, load_texture
|
||||||
import glfw
|
import sdl2
|
||||||
import imgui as im
|
import imgui as im
|
||||||
|
import ctypes
|
||||||
import random
|
import random
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
@ -19,6 +20,7 @@ def get_bank():
|
|||||||
(world.current_user_id,))
|
(world.current_user_id,))
|
||||||
bank = cursor.fetchone()
|
bank = cursor.fetchone()
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
||||||
return (bank, resources)
|
return (bank, resources)
|
||||||
|
|
||||||
def get_store_items():
|
def get_store_items():
|
||||||
@ -420,10 +422,15 @@ def draw_moons():
|
|||||||
im.end_child()
|
im.end_child()
|
||||||
|
|
||||||
def draw_panels():
|
def draw_panels():
|
||||||
screen_width, screen_height = glfw.get_video_mode(glfw.get_primary_monitor())[0]
|
|
||||||
|
|
||||||
|
# get the window object from the ID
|
||||||
|
window = sdl2.SDL_GL_GetCurrentWindow()
|
||||||
|
|
||||||
|
# get the window size
|
||||||
|
w, h = ctypes.c_int(0), ctypes.c_int(0)
|
||||||
|
sdl2.SDL_GL_GetDrawableSize(window, ctypes.byref(w), ctypes.byref(h))
|
||||||
# TODO: We probably don't need to create a "Main" window...
|
# TODO: We probably don't need to create a "Main" window...
|
||||||
im.set_next_window_size(screen_width, screen_height)
|
im.set_next_window_size(float(w.value), float(h.value))
|
||||||
|
|
||||||
# Set the next window position to (0, 0) to make the window cover the entire screen
|
# Set the next window position to (0, 0) to make the window cover the entire screen
|
||||||
im.set_next_window_position(0, 0)
|
im.set_next_window_position(0, 0)
|
||||||
@ -510,7 +517,8 @@ world.stakes = get_stakes()
|
|||||||
world.wells = get_all_wells()
|
world.wells = get_all_wells()
|
||||||
|
|
||||||
def imgui_init():
|
def imgui_init():
|
||||||
world.moon_img_tex_id = texture_id = load_texture("moon.png")
|
world.moon_img_tex_id = load_texture("moon.png")
|
||||||
|
# pass
|
||||||
|
|
||||||
imguiWindow = ImguiWindow(imgui_init, draw_panels, "Moon Miner Test", 1400, 1000)
|
imguiWindow = ImguiWindow(imgui_init, draw_panels, "Moon Miner Test", 1400, 1000)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user