Difference between revisions of "svgalib/es"

From Free Pascal wiki
Jump to navigationJump to search
Line 61: Line 61:
 
It is possible that you must be root to run these programs, The SVGAlib docs I have aren't clear about that. If the programs should be able run as another user, you should make them setuid root. I tested everything as root, and it ran smoothly, your mileage may vary, however.
 
It is possible that you must be root to run these programs, The SVGAlib docs I have aren't clear about that. If the programs should be able run as another user, you should make them setuid root. I tested everything as root, and it ran smoothly, your mileage may vary, however.
  
http://wiki.freepascal.org/index.php?title=svgalib&action=edit&section=6
+
== Future Plans ==
 +
It would be nice to have a borland style GRAPH unit wrapped around this; just for beginners or people who wish to port some old DOS code.
 +
 
 +
Go to back [[Package_List|Packages List]]
 +
 
 +
[[Category:Packages]]
 +
[[Category:Unix]]
 +
[[Category:Linux]]

Revision as of 18:29, 4 November 2014

Descripción

Bajo Linux/BSD, podemos utilizar libvga para acceder a la pantalla gráfica desde el modo consola. Free Pascal tiene una unidad que hace posible el enlazado de la librería libvga. Se puede encontrar la unidad, además del makefile y algunos programas de test dentro de la instalación de FreePascal. Es necesario compilarlo, poner la referencia dentro del programa (o unidad) que estemos creando y listo. Hay dos uidades en este paquete:

Ubicación de estos ficheros a modo orientativo con la versión de FreePascal 2.6.4 es:


./usr/share/fpcsrc/2.6.4/packages/svgalib ./usr/lib/fpc/2.6.4/units/x86_64-linux//svgalib

svgalib.o (svgalib.pp) vgamouse.o (vgamouse.pp)

Esto es para 64 bits pero lo encontrais con la variante de 32 sin problema.

  • svgalib el interface actual libvha.
  • vgamouse extensiónes del ratón para poder manejar el ratón bajo svgalib.

./usr/share/fpcsrc/2.6.4/packages/svgalib/examples/makefile.fpc

./usr/share/fpcsrc/2.6.4/packages/svgalib/examples/vgatest.pp

./usr/share/fpcsrc/2.6.4/packages/svgalib/examples/testvga.pp

Requisitos

Para utilizar esta unidad se necesita al menos:

  • Free Pascal 0.99.5 o superior.
  • libsvga 1.2.10 o superior.

Instalación

La unidad svga viene con los paquetes de FreePascal. Contiene un subdirectorio svgalib al que una vez accedido podemos realizar lo siguiente:

Editar el fichero makefile para adaptarlo al setup (compilador, opciones, donde queremos que se instale). A continuación tecleamos:

make

con lo cual todas las unidades necesarias se compilan. Finalmente tecleamos:

make install

Con esto lo que hacemos es instalar las unidades citadas.

http://www.svgalib.org/

Testing

Two small testprograms have been provided:

  • vgatest : This is a translation of the C program that comes with svgalib.
  • testvga : A Small program to demonstrate that you can draw lines on the screen in any mode.

typing

make test

will compile the programs.

Caveats

It is possible that you must be root to run these programs, The SVGAlib docs I have aren't clear about that. If the programs should be able run as another user, you should make them setuid root. I tested everything as root, and it ran smoothly, your mileage may vary, however.

Future Plans

It would be nice to have a borland style GRAPH unit wrapped around this; just for beginners or people who wish to port some old DOS code.

Go to back Packages List