Recent

Author Topic: [SOLVED] Castle Game Engine. Multi Window.  (Read 600 times)

yus

  • New Member
  • *
  • Posts: 31
[SOLVED] Castle Game Engine. Multi Window.
« on: September 23, 2020, 09:08:03 pm »
Hello!

I have a problem.

It's my first expirience using Castle Game Engine.

I try show few windows with TCastleControlBase component.
I have main form with button, after click button i create form, the TCastleControlBase located at second form.
Second form also contains FImage := TDrawableImage.Create('castle-data:/tux_walking.png');
After click to button in main window. First created window show image, when a try show second window i have a problem.

Where i wrong?
« Last Edit: September 25, 2020, 04:26:49 am by yus »

Seenkao

  • Jr. Member
  • **
  • Posts: 90
Re: Castle Game Engine. Multi Window.
« Reply #1 on: September 24, 2020, 07:39:07 am »
По опыту работы с OpenGL, я бы не советовал использовать два окна OpenGL. Это несёт с собой потерю производительности и увеличение на использование ресурсов видеокарты.

translate:
from experience with OpenGL, i do not recommend using two windows OpenGL. This brings with it a loss in performance and an increase in the use of video card resources.

yus

  • New Member
  • *
  • Posts: 31
Re: Castle Game Engine. Multi Window.
« Reply #2 on: September 24, 2020, 12:30:14 pm »
from experience with OpenGL, i do not recommend using two windows OpenGL. This brings with it a loss in performance and an increase in the use of video card resources.
I understand. But trying to quickly solve a small task using multiple windows, i saw this problem.

circular

  • Hero Member
  • *****
  • Posts: 3563
    • Personal webpage
Re: Castle Game Engine. Multi Window.
« Reply #3 on: September 24, 2020, 12:34:07 pm »
Can you be more specific about your problem?

It is possible to use 2 OpenGL contexts, though it is important to load textures in the right context. For a component that would be in for example in its Paint event. You need to load the textures twice if you want to display them in both context. So as Seenkao alluded to, it will take more VRAM to do so.
Conscience is the debugger of the mind

yus

  • New Member
  • *
  • Posts: 31
Re: Castle Game Engine. Multi Window.
« Reply #4 on: September 24, 2020, 12:40:47 pm »
Can you be more specific about your problem?

It is possible to use 2 OpenGL contexts, though it is important to load textures in the right context. For a component that would be in for example in its Paint event. You need to load the textures twice if you want to display them in both context. So as Seenkao alluded to, it will take more VRAM to do so.

i attach simple project for demonstrate this problem.

Thanks. Later i will try use your recomendation.

michalis

  • Full Member
  • ***
  • Posts: 108
    • Homepage
Re: Castle Game Engine. Multi Window.
« Reply #5 on: September 24, 2020, 11:28:07 pm »
Fixed in CGE in https://github.com/castle-engine/castle-engine/commit/b6d66e9a753585065f4b554996c41ee2bd8b88aa :) It was a cool team effort on CGE Discord , thanks to which we nailed down the problem quickly.




 

TinyPortal © 2005-2018