Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiko2k committed Jan 22, 2025
1 parent e247915 commit 28fdf7f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
3 changes: 2 additions & 1 deletion src/tauon/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ def transfer_args_and_exit() -> None:
os.environ["SDL_VIDEODRIVER"] = "x11"


sdl3.SDL_Init(sdl3.SDL_INIT_VIDEO)
sdl3.SDL_Init(sdl3.SDL_INIT_VIDEO | sdl3.SDL_INIT_EVENTS)

err = sdl3.SDL_GetError()
if err and "GLX" in err.decode():
logging.error(f"SDL init error: {err.decode()}")
Expand Down
14 changes: 8 additions & 6 deletions src/tauon/t_modules/t_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
import socket
import subprocess
import sys

import threading
import time
import urllib.parse
Expand Down Expand Up @@ -688,7 +687,7 @@ def reload(self) -> None:
def render(self, x: int, y: int, colour=None) -> None:
self.rect.x = round(x)
self.rect.y = round(y)
sdl3.SDL_RenderCopy(renderer, self.texture, None, self.rect)
sdl3.SDL_RenderTexture(renderer, self.texture, None, self.rect)


class WhiteModImageAsset:
Expand Down Expand Up @@ -41544,7 +41543,7 @@ def hit_callback(win, point, data):

update_layout = True

event = sdl3.SDL_Event()


mouse_moved = False

Expand Down Expand Up @@ -42711,6 +42710,9 @@ def drop_file(target):

# MAIN LOOP

event = sdl3.SDL_Event()
event_ptr = ctypes.pointer(event)

while pctl.running:
# bm.get('main')
# time.sleep(100)
Expand Down Expand Up @@ -43160,7 +43162,7 @@ def drop_file(target):

i_x = pointer(c_int(0))
i_y = pointer(c_int(0))
sdl3.SDL_GL_GetDrawableSize(t_window, i_x, i_y)
sdl3.SDL_GetWindowSizeInPixels(t_window, i_x, i_y)
window_size[0] = i_x.contents.value
window_size[1] = i_y.contents.value

Expand Down Expand Up @@ -44173,8 +44175,8 @@ def drop_file(target):
gui.showed_title = False

if not gui.mouse_in_window and not bottom_bar1.volume_bar_being_dragged and not bottom_bar1.volume_hit and not bottom_bar1.seek_hit:
mouse_position[0] = -300
mouse_position[1] = -300
mouse_position[0] = -300.
mouse_position[1] = -300.

if gui.clear_image_cache_next:
gui.clear_image_cache_next -= 1
Expand Down
10 changes: 0 additions & 10 deletions src/tauon/t_modules/t_themeload.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@
from typing import TYPE_CHECKING

from PIL import Image
from sdl2 import (
SDL_CreateTextureFromSurface,
SDL_DestroyTexture,
SDL_FreeSurface,
SDL_Rect,
SDL_RenderCopy,
SDL_SetTextureAlphaMod,
rw_from_object,
)
from sdl2.sdlimage import IMG_Load_RW

from tauon.t_modules.t_extra import rgb_add_hls, test_lumi

Expand Down

0 comments on commit 28fdf7f

Please sign in to comment.