JonathanMurray / JonathanMurray/python-2d-game

Screen resolution bug when running the game

Đang mở
#35 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
103
Fork
26
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello @JonathanMurray. Hello everyone.
Here I bring a temporary solution when running the game and shows screen resolution bug when running the game.

**To reproduce this problem:**
Just start the game and some incompatibility with the screen resolution identification will appear. Causes a resolution bug, the game is immediately stopped.

**Causes investigated:**
Relatively associated this error with incompatibility of the video driver with openGL applications. I still don't know which video cards can be affected, here I am using the VGA compatible controller for Intel Skylake GT2 [HD Graphics 520].

**Temporary solution:**
Disable the fullscreen at line 47 of the main.py file in the "/python-2d-game-3/pythongame" installation directory of the game.
Change `self.fullscreen = True` to `self.fullscreen = False`

So that it is:
```python
class Main:
def __init__(self, map_file_name: Optional[str], chosen_hero_id: Optional[str], hero_start_level: Optional[int],
start_money: Optional[int]):

cmd_flags = CommandlineFlags(map_file_name, chosen_hero_id, hero_start_level, start_money)

pygame.init()

print("Available display modes: " + str(pygame.display.list_modes()))

self.fullscreen = False
self.pygame_screen = self.setup_screen()
```

**Error message:**
```
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 153 (XFree86-VidModeExtension)
Minor opcode of failed request: 10 (XF86VidModeSwitchToMode)
Value in failed request: 0x220000e
Serial number of failed request: 265
Current serial number in output stream: 268
```
**Video card system registration and installed driver:**
```
*-display
description: VGA compatible controller
product: Skylake GT2 [HD Graphics 520]
manufacturer: Intel Corporation
ID: 2
bus information: pci@0000:00:02.0
version: 07
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:156 memória:a0000000-a0ffffff memória:90000000-9fffffff porta de E/S:4000(tamanho=64) memória:c0000-dffff
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.