buildgl.pp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. {
  2. $Id$
  3. GL unit creation tool helpers
  4. (c) 1999 Sebastian Guenther, [email protected]
  5. }
  6. {$MODE objfpc}
  7. {$H+}
  8. unit buildgl;
  9. interface
  10. uses SysUtils, Classes;
  11. type
  12. TDefReader = class
  13. protected
  14. FInterfaceBlock, FProcs: TStringList;
  15. public
  16. constructor Create(const Filename: String);
  17. property InterfaceBlock: TStringList read FInterfaceBlock;
  18. property Procs: TStringList read FProcs;
  19. end;
  20. implementation
  21. constructor TDefReader.Create(const Filename: String);
  22. type
  23. TCurState = (stateNothing, stateCopyInterface, stateProcs);
  24. var
  25. f: Text;
  26. s: String;
  27. state: TCurState;
  28. begin
  29. state := stateNothing;
  30. FInterfaceBlock := TStringList.Create;
  31. FProcs := TStringList.Create;
  32. Assign(f, Filename);
  33. Reset(f);
  34. while not EOF(f) do begin
  35. ReadLn(f, s);
  36. if Copy(s, 1, 1) = '#' then continue; // Skip comments
  37. if s = '%COPY_INTERFACE' then
  38. state := stateCopyInterface
  39. else if s = '%PROCS' then
  40. state := stateProcs
  41. else if s = '%END' then
  42. state := stateNothing
  43. else
  44. case state of
  45. stateCopyInterface: InterfaceBlock.Add(s);
  46. stateProcs: Procs.Add(s);
  47. end;
  48. end;
  49. Close(f);
  50. end;
  51. end.
  52. {
  53. $Log$
  54. Revision 1.4 2000-09-03 21:25:45 peter
  55. * new updated version
  56. * gtkglarea unit and demo
  57. * win32 opengl headers
  58. * morph3d demo
  59. Revision 1.1 2000/07/13 06:34:17 michael
  60. + Initial import
  61. Revision 1.1 2000/05/26 09:22:39 alex
  62. universal cross platform unit file generator
  63. Revision 1.1 1999/12/23 13:51:50 peter
  64. * reorganized, it now doesn't depend on fcl anymore by default
  65. Revision 1.1 1999/11/28 17:55:22 sg
  66. * Added new unit generation tools and auto-generated GL units for Linux
  67. }