HC_Show_Device_Info
-
void HC_Show_Device_Info(char const *driver, char const *item, char *data)
Returns selected information about the physical device.
Occasionally, a program needs to know something specific about the graphical device it is running on. For example, it might need the number of available colors in order to know how to allocate them efficiently. Or it might require the screen resolution so as to judge how much detail to present, or it might need to be able to figure the true physical size of figures on the screen.
- Supported options:
alive, analytics, anti-alias, colors, current window, dc dots, 3d dots, dc lines, 3d lines, dc polygons, polygons, dc_triangles, 3d triangles, depth peeling layers, display, display types, double buffer, driver config, driver config id, driver config version, driver type, driver version, event interrupted, exists, gouraud shading, graphics card name, hardware cutting planes, hardware lights, keyboard, locater, locater buttons, locater type, max colors, max pixels, max size, max texture size, occlusion, occlusion queries, pixels, pixel aspect_ratio, phong lighting, planes, quick moves method, rasters, resolution, resume update, size, static time, statics created, stereo, started, update time, video memory, window aspect ratio, windowing system, Z buffer depth
- DETAILS
If the device cannot be started up before the inquiry is performed, see the note below.
If item is not applicable to the device represented by driver - for example, the number of pixels on a pen plotter - a blank or null string is returned.
The choices for item are as follows:
“yes” if the device has been started and it appears to be in working order, otherwise “no”.
- alive
This command differs from Show_Driver_Options() in that these characteristics cannot be modified by the program.
- analytics
Approximate number of analytics drawn by this driver level during the last update.
- anti-alias
“yes” if the device has the necessary support for accelerated full-screen anti-aliasing, otherwise “no”.
- available gpus
Show all of the available GPU drivers, returned as a comma-separated string. For example: Nvidia GEForce 1060,Intel(R) HD Graphics 630,Microsoft Basic Render Driver
- colors
The number of physical color map entries in the frame buffer. Warning: On a 24-bit machine, this number may be large.
- current window ID
A decimal (not hexadecimal) encoding of the ID number of the windowing-system window that HOOPS Visualize has allocated. Only applicable if you’re running within a windowing system. See also the “use window ID” driver option.
- dc dots
Approximate number of dc dots drawn by this driver level during the last update.
- 3d dots
Approximate number of 3d dots drawn by this driver level during the last update.
- dc lines
Approximate number of dc lines drawn by this driver level during the last update.
- 3d lines
Approximate number of 3d lines drawn by this driver level during the last update.
- dc polygons
Approximate number of dc polygons drawn by this driver level during the last update.
- 3d polygons
Approximate number of 3d polygons drawn by this driver level during the last update.
- dc triangles
Approximate number of dc triangles drawn by this driver level during the last update.
- 3d triangles
Approximate number of 3d triangles drawn by this driver level during the last update.
- depth peeling layers
The return value is the number of depth peeling layers that are supported. With our OpenGL driver (but not OpenGL2), multi-layer depth peeling is restricted to non-antialiased windows, so the return value will be 1 if the most recent update had antialiasing enabled.
- display
“yes” if the device includes some sort of display, otherwise “no”.
- display type
“frame buffer”, “pen plotter”, “laser printer”, “HOOPS image”, “debugging printout”, or “macintosh pict”.
- double buffer
“copy”, “swap”, or “none” indicating the presence (and type), or absence of a double buffering capability.
- driver config
This is the config option string for the current hardware. It would have been set in the most recent call to Define_Driver_Config(). This item is only available for the OpenGL_Deprecated, OpenGL2, and DX11 drivers.
- driver config id
This is the driver id string which identifies the current hardware and can be used as the id string in a call to Define_Driver_Config(). This item is only available with the OpenGL_Deprecated, OpenGL2, and DX11 drivers.
- driver config version
This is the driver version string which identifies the current hardware and can be used in a subsequent call to Define_Driver_Config(). This item is only available with the OpenGL_Deprecated, OpenGL2, and DX11 drivers.
- driver type
Returns the name of the driver, and, in some cases, whether or not there is hardware acceleration. It returns one of the following strings: “Direct3D11” (DirectX11), “OpenGL2_Hardware”, “OpenGL2_Software”, “AGL_Software”, “AGL_Hardware”, “WGL_Software”, “WGL_Hardware”, “GLX_Software”, “GLX_Hardware”, “MSWindows”, “CGM3”, “HPGL”, “CGM”, “HPGL2”, “Image”, “Qt”, “Printf”, “PDF”, “PostScript”, “X11”, “whip2d”
- driver version
The version number of the device driver (possibly useful when reporting an error). Note that device drivers have version numbers independent of the HOOPS Visualize version number reported by Print_Version() .
- event interrupted
”yes” if the last update on this device was interrupted by an event. This event can be a HOOPS Visualize event from the driver, a user-queued special event, or a call to HIC_Abort_Update() from a driver’s “exit update” callback. Timed updates that are interrupted because of time do not count as event interrupted.
- exists
“yes” if this segment does have a driver attribute, and the driver is actually connected to a physical device, otherwise “no”.
- gouraud shading
“yes” if the device is able to do a bilinear color interpolation, otherwise “no”. This is independent of “hardware lights”.
- graphics card name
Given the driver segment name, returns the human-readable graphics card name, for example, “Radeon RX 570 Series”.
char name[4096]; // adjust first parameter to your environment HC_Show_Device_Info("/driver/opengl2", "graphics card name", name);
- hardware cutting planes
The decimal number of cutting planes supported by the hardware. If this number is zero or if it is less than the number of cutting planes requested by your program, cutting planes will be done in software.
- hardware lights
The decimal number of lights supported by the hardware. If this number is zero or if it is less than the number of lights requested by your program, lighting will be done in software.
- keyboard
“yes” if the device includes a keyboard, otherwise “no”.
- locater
“yes” if a locater device (mouse, tablet, etc.) is included, otherwise “no”.
- locater buttons
The number of buttons on the locater device (i.e., the mouse).
- locater type
“tablet”, “mouse”, “joystick”, etc.
- max colors
Usually the same as colors. The number of colors might be slightly larger on windowing systems that allow the windowing system’s “reserved” colors (cursors, window backgrounds, etc.) to be grabbed and recycled by the user program. To tell HOOPS Visualize to try to grab the extra colors, use the “number of colors” driver option.
- max pixels
Two integer values, separated by a comma, representing the width and the height of the physical screen in pixels. On a nonwindowing system, this will generally be equal to “pixels”. On a windowing system this represents the full physical screen, as opposed to the current working window.
- max size
Two floating-point values, separated by a comma, representing the width and the height of the physical screen in centimeters.
- max texture size
A single integer value indicating the maximum width or height of a texture if it is to be loaded into video memory. This value will vary depending on the video card.
- occlusion
Indicates that the device can do occlusion testing.
- occlusion queries
Approximate number of occlusion queries which occured during the last update.
- pixels
Two integer values, separated by a comma, representing the width and the height of the currently-displayed outermost window (i.e.,?Picture’s window) in pixels.
- pixel aspect ratio
A floating point value representing the width-to-height ratio of a single pixel. This is figured as the horizontal resolution divided by the vertical resolution, and should always be accurate.
- phong lighting
“yes” if the device is able to do interpolate surface normal vectors pixel-by-pixel. Phong lighting requires “hardware lights” > 0.
- planes
The number of bit planes in the frame buffer.
- quick moves method
The quick moves method actually used in the most recent update. Can return spriting, overlay, xor, or none.
- rasters
Approximate number of rasters drawn by this driver level during the last update.
- resolution
Two floating-point values, separated by a comma, representing the pixels per centimeter horizontally and vertically. The resolution is the number of pixels divided by the size. Note again that the size might not be accurate.
- resume update
”Yes” if the last update was trying to finish rendering the scene from an aborted update. An aborted update can be the result of either a timed update (see Update_Display_Timed()) or an interrupted update.
- size
Two floating-point values, separated by a comma, representing the width and the height of the currently-displayed outermost window in centimeters. Note that some machines allow a variety of screen sizes to be plugged into them, and it might not be possible for HOOPS Visualize to detect which is which.
- started
“yes” if at least one update has been attempted on the device, otherwise “no”.
- statics created
Returns the time, in seconds, taken to generate all the static trees during the last update, if any.
- statics created
Returns the number of static trees generated during the last update.
- stereo
“yes” if the device has stereo viewing capabilities, otherwise “no”.
- update time
One floating point value that indicates the amount of time taken during the previous update. Please bear in mind, however, that this is limited to the resolution of the system timer. In practice, that means that frame rates above 20 per second cannot be accurately measured in this manner.
- video memory
One integer showing the amount of video memory reported to be available by the hardware. When no information is provided by the graphics hardware, it simply returns 0.
- window aspect ratio
A floating point value representing the width-to-height ratio of the current outermost window. This is figured as the horizontal size divided by the vertical size, and should always be accurate.
- windowing system
“yes” if this driver is for use with a windowing system, otherwise “no”.
- Z buffer depth
The decimal number of bits in the display’s hardware Z-buffer. If this number is zero, hidden surfaces cannot be done in hardware, only in software. If this number is less than 16, the hardware hidden surfaces may be very inaccurate.
- NOTES
If the device is not started - i.e., if at least one update has not been done (via Get_Selection() , etc.) - Show_Device_Info() will force a call to Update_Display() in the hopes of acquiring a device it can show information about. An exception is if you’re asking whether the device exists yet (see “exists” above), no update is forced. You have to be wary of this extra update if Show_Device_Info() is called early in your initialization and your driver options (“subscreen” or “use window ID”, for example) have not been set up yet by your program. If this is a problem, just set window visibility off in the appropriate driver, which is most commonly “?picture” - Show_Device_Info() will be able to do its update but nothing will be drawn on the user’s screen.
Options that return the number of objects drawn in the last update are supported by the OpenGL driver only.
- RESTRICTIONS
See also
HC_Set_Driver_Options, HC_Set_Window, HC_Show_Font_Info, HC_Set_Rendering_Options.
- Parameters
driver – - The name of a segment that has a device driver attribute. Often “?Picture”.
item – - The type of information to be returned by this call. Uppercase versus lowercase doesn’t matter.
data – - The value of item for driver. Numeric values are returned as their alphanumeric equivalents. Returned to user. Passed by reference always.