Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > VCL

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 10-28-2015, 11:21 AM
balala balala is offline
Junior Member
 
Join Date: Jul 2010
Posts: 28
Default Opengl screensaver preview

Hi all,

I'm working on an Opengl screensaver, in Delphi Lite 10. The code is ready and works well (in fact the main code isn't mine, I downloaded it from here: http://www.sulaco.co.za/opengl_proje..._metaballs.htm) but I'd need to create a preview of the screensaver. And here're starting the problems: I've created a while ago another screensaver (that wasn't an opengl code!) and I knew how to create the preview, but here it's not working: anything I do, the preview isn't created, remains blank. My question would be how can be made the preview to work in opengl?
The project code:

program Metaballs;
uses
Forms,
SysUtils,
uMain in 'uMain.pas' {Form1},
Unit2 in 'Unit2.pas' {Config};
{$R *.res}
begin
Application.Initialize;
Prev := false;
if ParamCount > 0 then begin
if UpperCase(ParamStr(1)) = '/P' then begin
Application.CreateForm(TfMain, fMain);
fMain.AlphaBlend := false;
fMain.Width := 152;
fMain.Height := 112;
fMain.ParentWindow := StrToInt(ParamStr(2));
end else if UpperCase(ParamStr(1)) = '/S' then begin
{ScrnFrm needs to be the Main Form.}
Application.CreateForm(TfMain, fMain);
fMain.Width := Screen.Width;
fMain.Height := Screen.Height;
end else begin
{CfgFrm needs to be the Main Form.}
Application.CreateForm(TConfig, Config);
Application.CreateForm(TfMain, fMain);
end;
end
else begin
Application.CreateForm(TfMain, fMain);
fMain.Width := Screen.Width;
fMain.Height := Screen.Height;
end;
Application.Run;
end.

If I remove the fMain.ParentWindow := StrToInt(ParamStr(2)); line, the preview screen is created, but as a distinct window, not in the screensaver preview window.
I also know the code isn't finished yet. I'll have to set a lot of things later (window size, to stay on top and maximized), but for now, I'd like to see if the preview can be made to work and how, if it can.
I should have to post the code of the main form, but I can't because the message become too long. If it's needed I can upload the whole project and I'll do, if someone belives can help.

Thanks in advance.
Reply With Quote
  #2  
Old 10-29-2015, 05:58 PM
rojam rojam is offline
Senior Member
 
Join Date: Jun 2015
Posts: 198
Default

Quote:
Originally Posted by balala View Post
If I remove the fMain.ParentWindow := StrToInt(ParamStr(2)); line, the preview screen is created, but as a distinct window, not in the screensaver preview window.
Maybe the post here may help.
Reply With Quote
  #3  
Old 10-30-2015, 06:56 PM
balala balala is offline
Junior Member
 
Join Date: Jul 2010
Posts: 28
Default

Thanks, but it didn't help. I just can't make it to work. But thanks anyway.
Reply With Quote
Reply

Tags
opengl, screensaver

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:24 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.