* * *

Author Topic: Installing LazOpenGLContext  (Read 4678 times)

jacmoe

  • Sr. Member
  • ****
  • Posts: 255
    • 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: 1404
  • 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: 1404
  • 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

FangQ

  • Jr. Member
  • **
  • Posts: 85
Re: Installing LazOpenGLContext
« Reply #38 on: June 27, 2017, 03:04:27 pm »
If I remember correctly, to be able to use LazOpenGL you will need to install libgl1-mesa-dev if you use Ubuntu.

I am having exactly the same issue on my Ubuntu 14.04 box - same "lazarus.pp(1,1) Fatal: Cannot find lazopenglcontext used by Lazarus" error, and I do have the libgl1-mesa-dev installed in my system. My Lazarus version is 1.6 (FPC 3.0).

any suggestions what else I should be looking?

Handoko

  • Hero Member
  • *****
  • Posts: 1404
  • My goal: build my own game engine using Lazarus
Re: Installing LazOpenGLContext
« Reply #39 on: June 27, 2017, 03:28:01 pm »
Make sure you've already did these:

1. Install libgl1-mesa-dev

2. Install LazOpenGLContext 0.0.1 on your Lazarus
To do it:
Lazarus main menu > Packages > Install/Uninstal Packages > on the right panel, select: LazOpenGLContext 0.0.1 > Click "Install Selection" button > Save and rebuild IDE > wait several minutes and restart your Lazarus

John_Nicol

  • New member
  • *
  • Posts: 6
Re: Installing LazOpenGLContext
« Reply #40 on: July 30, 2017, 08:36:16 am »
I hope it is in order for me to join this interesting  exchange.  I am also trying to set up a bitmap system which, as a test programme, reads the colours at all points x,y on a complex bitmap image of a world map loaded onto Image1.  This provides me with integer or binary code for Red, Green and Blue in a corresponding array.

However, I want to reproduce the same image by writing the colours to each pixel over a similar sized area in Image2.  I have tried a lot of the open suggestions on the net with various example codes, but nothing provides me with a  line of code that actually writes a group of the three intensities of colour to a bitmap.  I am therefore trying the route through GRABitmap which is giving me considerable grief in apparently requiring "OpenGLContext" in then Uses (I think)  Having put it there along with BGRABitmapTypes, BGRAOpenGL, BGRACanvasGL, and a couple of other objects, the compiler keeps telling me it cannot find that:

 "Fatal Error: Cannot find OpenGlContextt used by BGLVirtualScreen; Check if Package LazOpenGLC9ntext is in the dependencies of package BGRABitmapPack". 

I believe I have gone through all the recommended steps of installation and checked what is in Packages for OpenGLContext but nothing seems to help.  BGLVirtualScreen arrived of its own accord.  John Nicol

Handoko

  • Hero Member
  • *****
  • Posts: 1404
  • My goal: build my own game engine using Lazarus
Re: Installing LazOpenGLContext
« Reply #41 on: July 31, 2017, 06:03:43 am »
"Fatal Error: Cannot find OpenGlContextt used by BGLVirtualScreen; Check if Package LazOpenGLC9ntext is in the dependencies of package BGRABitmapPack". 

Make sure the LazOpenGLContext package is installed properly on your Lazarus. You can check the view components window by using shortcut: [Ctrl+Alt+P]. See the attached image, if you can't see TOpenGLControl in your view components windows then you have not installed it correctly.

 

Recent

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