Recent

Author Topic: How to embed SD2 window to panel  (Read 602 times)

Imants

  • Full Member
  • ***
  • Posts: 198
How to embed SD2 window to panel
« on: June 22, 2024, 12:43:13 pm »
I am using Ubuntu 24.04 LTS and I want to embed SDL2 window inside panel. I found this code example
 
GtkWidget := PGtkWidget(panel1.handle);
Handle := Pointer(GDK_WINDOW_XWINDOW(GtkWidget^.window));   
SDLWindow := SDL_CreateWindowFrom(Handle);   

But when I run code I get this error:

The program 'application1' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 192 error_code 3 request_code 20 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

MarkMLl

  • Hero Member
  • *****
  • Posts: 7037
Re: How to embed SD2 window to panel
« Reply #1 on: June 22, 2024, 10:03:40 pm »
The program 'application1' received an X Window System error.

This is not my area of expertise and I might not be able to help further, but... are you sure Ubuntu is actually using X11?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Imants

  • Full Member
  • ***
  • Posts: 198
Re: How to embed SD2 window to panel
« Reply #2 on: June 23, 2024, 02:46:18 pm »
Apparently yes still uses because my code started to work when I changed panel to TOpenGLControl. But now I have different problem. It draws only part of my scene

 

TinyPortal © 2005-2018