MemViewerD.dpr 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. {: Rendering to a TMemoryViewer and using the render as texture.
  2. This sample illustrates use of the TGLMemoryViewer to render to a texture.
  3. The simple scene features a lone cube, when rendered to the memory viewer,
  4. a red background is used (the TGLSceneViewer uses a gray background).
  5. After each main viewer render, the scene is rendered to the memory viewer
  6. and the result is copied to the texture of the cube (a "BlankImage" was
  7. defined at runtime, because we only need to specify the texture size).
  8. Most of the time, you won't need to render textures at each frame, and a set
  9. options illustrates that. The 1:2 mode is significantly faster and visually
  10. equivalent (even with VSync on, to limit the framerate).
  11. Never forget a memory viewer will use 3D board memory, thus reducing
  12. available space for GLVectorGeometry and textures... try using only one memory
  13. viewer and maximize its use.
  14. This sample will only work on 3D boards that support WGL_ARB_pbuffer, which
  15. should be the case for all of the modern boards, and even some of the older
  16. ones.
  17. }
  18. program MemViewerD;
  19. uses
  20. Forms,
  21. fMemViewerD in 'fMemViewerD.pas' {FormMemViewer};
  22. {$R *.res}
  23. begin
  24. Application.Initialize;
  25. Application.CreateForm(TFormMemViewer, FormMemViewer);
  26. Application.Run;
  27. end.