added compilation mode to widget units

some clean-up and fixing of compiler warnings
initial import of the fpmake build file

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2228 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blaszijk
2012-01-04 23:13:24 +00:00
parent 1b73aa5e62
commit b61fa2502b
5 changed files with 81 additions and 4 deletions

View File

@ -0,0 +1,18 @@
type
//add more here
NV_CONTEXT = (GLUT);
NV_PAINTER = (GL);
const
NV_DEBUG = True;
NV_DEBUG_FLAGS: array [0..2] of string = ('-g', '-gl', '-gh');
NV_PROFILE = False;
NV_PROFILE_FLAGS: array [0..0] of string = ('-pg');
var
//choose the context
NV_ACTIVE_CONTEXT: NV_CONTEXT = GLUT;
//choose the painter
NV_ACTIVE_PAINTER: NV_PAINTER = GL;

View File

@ -0,0 +1,57 @@
program fpmake;
{$mode objfpc} {$H+}
uses
fpmkunit;
{$include config.inc}
var
P: TPackage;
i: integer;
begin
with Installer do
begin
//create nvwidgets package
P := AddPackage('nvwidget');
P.Version := '1.00';
//P.Options.Add('-MObjFPC');
if NV_DEBUG then
for i := 0 to High(NV_DEBUG_FLAGS) do
P.Options.Add(NV_DEBUG_FLAGS[i]);
if NV_PROFILE then
for i := 0 to High(NV_PROFILE_FLAGS) do
P.Options.Add(NV_PROFILE_FLAGS[i]);
//base widget units
P.Targets.AddUnit('./nvwidgets/nvwidgets.pas');
write('package ', P.Name, ' configured for ');
//context units
case NV_ACTIVE_CONTEXT of
GLUT: begin
write('the GLUT context');
P.Targets.AddUnit('./nvwidgets/nvglutwidgets.pas');
end;
end;
//painter units
case NV_ACTIVE_PAINTER of
GL: begin
writeln(' with the OpenGL painter');
P.UnitPath.Add('./gl/');
P.UnitPath.Add('./nvglutils/.');
P.Targets.AddUnit('./nvwidgets/nvglwidgets.pas');
end;
end;
Run;
end;
end.

View File

@ -6,6 +6,8 @@
////////////////////////////////////////////////////////////////////////////////
unit nvShaderUtils;
{$mode objfpc}{$H+}
interface
{ $define NV_REPORT_COMPILE_ERRORS}

View File

@ -25,7 +25,6 @@ var
errorScale: double = 4;
compressionRate: double = 1;
texture: GLuint = 0;
let: string = 'linedit test';
procedure closeapp;
begin
@ -80,8 +79,6 @@ var
formatIdx: integer;
Text: string;
textureRect: Rect;
c: integer;
begin
none.Rect(0, 0);

View File

@ -9,6 +9,8 @@
////////////////////////////////////////////////////////////////////////////////
unit nvGLWidgets;
{$mode objfpc}{$H+}
interface
uses
@ -124,7 +126,7 @@ type
public
constructor Create;
destructor Destroy;
destructor Destroy; override;
procedure _begin(const window: Rect); override;
procedure _end; override;
@ -261,6 +263,7 @@ end;
destructor GLUIPainter.Destroy;
begin
Font.Clean;
inherited Destroy;
end;
procedure GLUIPainter._begin(const window: Rect);