* * *

Author Topic: Installing LazOpenGLContext  (Read 2483 times)

jacmoe

  • Full Member
  • ***
  • Posts: 242
    • Jacmoe's Cyber SoapBox
Re: Installing LazOpenGLContext
« Reply #30 on: February 12, 2017, 06:55:34 pm »
Could you try and use Fpcupdeluxe instead?
It will install Lazarus / Free Pascal into your home directory.

Get it here: https://github.com/newpascal/fpcupdeluxe/releases/latest

Make it executable, run it and click 'Fixes' button. Should give you a link on the desktop which you can run.
You should be able to recompile/build/install the IDE and packages easily.

You need to install 'subversion' in order to use the tool.

Edit:
It will not mess with your global Lazarus / Free Pascal installation, so you can safely try it.
Uninstallation is just a rm -rf fpcupdeluxe away, if things go wrong.
« Last Edit: February 12, 2017, 07:08:29 pm by jacmoe »
more signal - less noise

ehj666

  • Jr. Member
  • **
  • Posts: 50
Re: Installing LazOpenGLContext
« Reply #31 on: February 12, 2017, 07:58:23 pm »
Ok, that took some doing but I think I have everything purged and rebuilt. Lazarus is coming up without any errors, inability to access files, etc. Is there anything I should do before trying to install the lazopenglcontext package. It is correctly showing as available, not as installed this time.

ehj666

  • Jr. Member
  • **
  • Posts: 50
Re: Installing LazOpenGLContext
« Reply #32 on: February 12, 2017, 08:14:12 pm »
Well I moved on. It looks like lazopenglcontext installed properly this time. It successfully compiled the example opengl application. It had a problem at run time in that it could not find "particle.png", but otherwise seems to be working.

ehj666

  • Jr. Member
  • **
  • Posts: 50
Re: Installing LazOpenGLContext
« Reply #33 on: February 12, 2017, 08:46:27 pm »
The example program, which references the unit OpenGLContext compiles fine, but when I go back to my program and put OpenGLContext in the uses claus, I am still getting an error "mainform.pas(29,51) Fatal: Cannot find OpenGLContext used by MainForm. Check if package LazOpenGLContext is in the dependencies of the Project Inspector."

The project inspector for the example program shows lazopenglcontext under required packages, but my program does not. I do not see exactly how to add it.under object inspector. Under "Install / Uninstall Package" lazopenglcontext is showing as installed in my program too.

Here is the beginning of my program:

Code: Pascal  [Select]
  1. {$mode objfpc}{$H+}
  2.  
  3. interface
  4.  
  5. uses
  6.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
  7.   ComCtrls, ExtCtrls, IniSettings, LCLTranslator, OpenGLContext, gl;
  8.  
  9. type
  10.  

Handoko

  • Hero Member
  • *****
  • Posts: 991
  • My goal: build my own game engine using Lazarus
Re: Installing LazOpenGLContext
« Reply #34 on: February 13, 2017, 02:48:23 am »
Glad to hear you now can compile the example without error.

The problem now is you don't know how to use it properly on new project. Here are several ways to use the OpenGLContext, pick one you feel convenient:

1. Using visual click and drop
Switch to form view mode (Lazarus main menu > View > Toggle Form/Unit view), goto the OpenGL component tab, click TOpenGLControl and drop it on the form.

2. Using Project Inspector
Lazarus main menu > Project > Project Inspector > right click on "Required Packages" > type and select "LazOpenGLContext" > Create New Requirement.

3. Manually edit the code
Lazarus main menu > Project > View Project Source > add "lazopenglcontext" in the use clause (in the project source).

Note:
Lazarus is not a simple IDE. It has a lot of 'hidden' tricks that waiting for you to try.

Lazarus project is different from the traditional Turbo Pascal file. It has project sources with extensions of *.lpr, *.lpi, *.lps. Simply  adding OpenGLContext in the use clause is not enough. You have to add it into the project *.lpr file too. So, the 3 options mentioned above it how to do it.

About the "particle.png" issue, you have to copy it from the original source folder and put it into your project folder, otherwise you can edit the code to tell it to look up to the old path.
« Last Edit: February 13, 2017, 03:05:38 am by Handoko »

ehj666

  • Jr. Member
  • **
  • Posts: 50
Re: Installing LazOpenGLContext
« Reply #35 on: February 13, 2017, 04:56:03 am »
Ok, got it. It is now working. Now a matter of porting my existing OpenGL code.

Thanks for all the help.

ehj666

  • Jr. Member
  • **
  • Posts: 50
Re: Installing LazOpenGLContext
« Reply #36 on: February 13, 2017, 02:35:04 pm »
One more thing regarding the fp install. The next day, software updater is showing a large number iof free pascal and related modules. I saw another post saying not to install these? If true, is there a way to turn off updates just for the free pascal modules?

Handoko

  • Hero Member
  • *****
  • Posts: 991
  • My goal: build my own game engine using Lazarus
Re: Installing LazOpenGLContext
« Reply #37 on: February 13, 2017, 02:46:30 pm »
You can use Synaptec Lock Version feature, read my yesterday post here:
http://forum.lazarus.freepascal.org/index.php/topic,35801.msg237373.html#msg237373

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus