Skip to content

Commit

Permalink
Merge pull request #282 from parasol-framework/test/build
Browse files Browse the repository at this point in the history
Gamepads & Gradients
  • Loading branch information
paul-manias authored Dec 6, 2024
2 parents 81dc21b + 694f206 commit 2c46940
Show file tree
Hide file tree
Showing 66 changed files with 1,462 additions and 584 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ int main() {

find_program (XXD_CMD "xxd")
find_program (PARASOL_CMD "parasol" NO_DEFAULT_PATH PATHS "${PARASOL_CMD_PATH}")
find_file (IDL_C_SCRIPT "idl-c.fluid" PATHS "${PROJECT_SOURCE_DIR}/scripts/dev/idl")
find_file (IDL_COMPILE_SCRIPT "idl-compile.fluid" PATHS "${PROJECT_SOURCE_DIR}/scripts/dev/idl")
find_file (FLUTE_SCRIPT "flute.fluid" PATHS "${PROJECT_SOURCE_DIR}/scripts/dev")
find_file (IDL_C_SCRIPT "idl-c.fluid" PATHS "${PROJECT_SOURCE_DIR}/tools/idl")
find_file (IDL_COMPILE_SCRIPT "idl-compile.fluid" PATHS "${PROJECT_SOURCE_DIR}/tools/idl")
find_file (FLUTE_SCRIPT "flute.fluid" PATHS "${PROJECT_SOURCE_DIR}/tools")

if (PARASOL_CMD STREQUAL "PARASOL_CMD-NOTFOUND")
message (STATUS "Definitions will not be built and tests are disabled.")
Expand All @@ -171,15 +171,15 @@ if (BUILD_TESTS)
endif ()

if (IDL_C_SCRIPT STREQUAL "IDL_C_SCRIPT-NOTFOUND")
message (FATAL_ERROR "The idl-c.fluid script was not found in ${PROJECT_SOURCE_DIR}/scripts/dev/idl")
message (FATAL_ERROR "The idl-c.fluid script was not found in ${PROJECT_SOURCE_DIR}/tools/idl")
endif ()

if (IDL_COMPILE_SCRIPT STREQUAL "IDL_COMPILE_SCRIPT-NOTFOUND")
message (FATAL_ERROR "The idl-compile.fluid script was not found in ${PROJECT_SOURCE_DIR}/scripts/dev/idl")
message (FATAL_ERROR "The idl-compile.fluid script was not found in ${PROJECT_SOURCE_DIR}/tools/idl")
endif ()

if (FLUTE_SCRIPT STREQUAL "FLUTE_SCRIPT-NOTFOUND")
message (FATAL_ERROR "The flute.fluid script was not found in ${PROJECT_SOURCE_DIR}/scripts/dev")
message (FATAL_ERROR "The flute.fluid script was not found in ${PROJECT_SOURCE_DIR}/tools")
endif ()

if (NOT MSVC)
Expand Down
108 changes: 108 additions & 0 deletions docs/xml/modules/classes/controller.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="class.xsl"?>

<book>
<info>
<name>Controller</name>
<type>class</type>
<module>Display</module>
<comment>Provides support for reading state-based game controllers.</comment>
<version>1</version>
<id>bf67c809</id>
<idstring>ID_CONTROLLER</idstring>
<category>IO</category>
<include>modules/controller.h</include>
<copyright>Paul Manias 2003-2024</copyright>
<description>
<p>Use the Controller class to read the state of game controllers that are recognised by the operating system.</p>
<p>Unlike analog devices that stream input commands (e.g. mice), gamepad controllers maintain a state that can be read at any time. The controller state is normally read at least once per frame, which can be achieved in the main inner loop, or in a separate timer.</p>
<p>Controller input management is governed by the <class name="Display">Display</class> class. The <code>GRAB_CONTROLLERS</code> flag must be defined in the active Display's Flags field in order to ensure that controller input can be received. Failure to do so may mean that the Controller object appears to work but does not receive input.</p></description>
<source>
<file>class_controller.cpp</file>
</source>
</info>

<actions>
<action>
<name>Query</name>
<comment>Get the current controller state.</comment>
<prototype>ERR acQuery(*Object)</prototype>
</action>

</actions>

<fields>
<field>
<name>Buttons</name>
<comment>JET button values expressed as bit-fields.</comment>
<access read="R">Read</access>
<type lookup="CON">CON</type>
<description>
<types lookup="CON"/>
</description>
</field>

<field>
<name>LeftStickX</name>
<comment>Left analog stick value for X axis, between -1.0 and 1.0.</comment>
<access read="R">Read</access>
<type>DOUBLE</type>
</field>

<field>
<name>LeftStickY</name>
<comment>Left analog stick value for Y axis, between -1.0 and 1.0.</comment>
<access read="R">Read</access>
<type>DOUBLE</type>
</field>

<field>
<name>LeftTrigger</name>
<comment>Left trigger value between 0.0 and 1.0.</comment>
<access read="R">Read</access>
<type>DOUBLE</type>
</field>

<field>
<name>Port</name>
<comment>The port number assigned to the controller.</comment>
<access read="R" write="I">Read/Init</access>
<type>INT</type>
<description>
<p>Set the port number to choose the controller that will be queried for state changes. The default of zero is assigned to the primary controller.</p>
<p>The port number can be changed at any time, so multiple controllers can be queried through one interface at the cost of overwriting the previous state. Check <fl>TotalPorts</fl> if your program supports more than one controller.</p>
</description>
</field>

<field>
<name>RightStickX</name>
<comment>Right analog stick value for X axis, between -1.0 and 1.0.</comment>
<access read="R">Read</access>
<type>DOUBLE</type>
</field>

<field>
<name>RightStickY</name>
<comment>Right analog stick value for Y axis, between -1.0 and 1.0.</comment>
<access read="R">Read</access>
<type>DOUBLE</type>
</field>

<field>
<name>RightTrigger</name>
<comment>Right trigger value between 0.0 and 1.0.</comment>
<access read="R">Read</access>
<type>DOUBLE</type>
</field>

<field>
<name>TotalPorts</name>
<comment>Reports the total number of controllers connected to the system.</comment>
<access read="G">Get</access>
<type>INT</type>
</field>

</fields>
<structs>
</structs>
</book>
47 changes: 4 additions & 43 deletions docs/xml/modules/classes/display.xml
Original file line number Diff line number Diff line change
Expand Up @@ -396,23 +396,13 @@
</description>
</field>

<field>
<name>CertificationDate</name>
<comment>String describing the date of the graphics driver's certification.</comment>
<access read="G">Get</access>
<type>STRING</type>
<description>
<p>The string in this field describes the date on which the graphics card driver was certified. If this information is not available from the driver, a <code>NULL</code> pointer is returned.</p>
</description>
</field>

<field>
<name>Chipset</name>
<comment>String describing the graphics chipset.</comment>
<access read="G">Get</access>
<type>STRING</type>
<description>
<p>The string in this field describes the graphic card's chipset. If this information is not retrievable, a <code>NULL</code> pointer is returned.</p>
<p>This string describes the graphic card's chipset, if known.</p>
</description>
</field>

Expand All @@ -422,7 +412,7 @@
<access read="G">Get</access>
<type>STRING</type>
<description>
<p>The string in this field describes the display device that is connected to the user's graphics card. If this information is not detectable, a <code>NULL</code> pointer is returned.</p>
<p>This string describes the display device that is connected to the user's graphics card.</p>
</description>
</field>

Expand All @@ -432,7 +422,7 @@
<access read="G">Get</access>
<type>STRING</type>
<description>
<p>The string in this field returns the name of the manufacturer that created the user's display device. If this information is not detectable, a <code>NULL</code> pointer is returned.</p>
<p>This string names the manufacturer of the user's display device.</p>
</description>
</field>

Expand All @@ -447,36 +437,6 @@
</description>
</field>

<field>
<name>DriverCopyright</name>
<comment>String containing copyright information on the graphics driver software.</comment>
<access read="G">Get</access>
<type>STRING</type>
<description>
<p>The string in this field returns copyright information related to the graphics driver. If this information is not available, a <code>NULL</code> pointer is returned.</p>
</description>
</field>

<field>
<name>DriverVendor</name>
<comment>String describing the vendor of the graphics driver.</comment>
<access read="G">Get</access>
<type>STRING</type>
<description>
<p>The string in this field returns the name of the vendor that supplied the graphics card driver. If this information is not available, a <code>NULL</code> pointer is returned.</p>
</description>
</field>

<field>
<name>DriverVersion</name>
<comment>String describing the version of the graphics hardware driver.</comment>
<access read="G">Get</access>
<type>STRING</type>
<description>
<p>The string in this field describes the graphic driver's version number. If this information is not detectable, a <code>NULL</code> pointer is returned.</p>
</description>
</field>

<field>
<name>Flags</name>
<comment>Optional flag settings.</comment>
Expand Down Expand Up @@ -783,6 +743,7 @@
<const name="CUSTOM_WINDOW">The display has been created with a custom window reference.</const>
<const name="DPMS_ENABLED">Power saving through DPMS is supported.</const>
<const name="FLIPPABLE">If <code>SCR::BUFFER</code> is used, this flag may be set by the display manager if it is possible to flip the buffer.</const>
<const name="GRAB_CONTROLLERS">Grab controllers for receiving input when the display has the focus.</const>
<const name="GTF_ENABLED">GTF frequency timings are supported.</const>
<const name="HOSTED">The display is a desktop hosted window.</const>
<const name="MAXIMISE">Special win32 flag.</const>
Expand Down
25 changes: 6 additions & 19 deletions docs/xml/modules/classes/surface.xml
Original file line number Diff line number Diff line change
Expand Up @@ -984,36 +984,23 @@ the surface area first).</li>

<constants lookup="JET" comment="JET constants are documented in GetInputEvent()">
<const name="ABS_XY">The X, Y values are defined as absolute coordinates, relative to the top-left of the display.</const>
<const name="ANALOG2_XY">As for <code>ANALOG_XY</code>, this type covers a second analog stick if present.</const>
<const name="ANALOG2_Z">As for <code>ANALOG_Z</code>, this type covers a second analog stick if present.</const>
<const name="ANALOG_XY">Position for the default analog control (on gamepads this is the left analog control). Analog values range between -1.0 and 1.0. A value of zero indicates that the control is at rest.</const>
<const name="ANALOG_Z">3D or yoke position for the default analog control. A negative value indicates that the control has been pulled out and a positive value indicates that it has been pushed in.</const>
<const name="BUTTON_1">Left mouse button, XBox A button, PS square button. Value is pressure sensitive, ranging between 0 - 1.0 (0 is released, 1.0 is fully depressed).</const>
<const name="BUTTON_1">Left mouse button; XBox A button, PS square button. Value is pressure sensitive, ranging between 0 - 1.0 (0 is released, 1.0 is fully depressed).</const>
<const name="BUTTON_10">Non-specific button assignment.</const>
<const name="BUTTON_2">Right mouse button, XBox X button, PS cross button.</const>
<const name="BUTTON_3">Middle mouse button, XBox Y button, PS triangle.</const>
<const name="BUTTON_4">XBox B button, PS circle.</const>
<const name="BUTTON_5">Left analog stick depressed.</const>
<const name="BUTTON_6">Right analog stick depressed.</const>
<const name="BUTTON_2">Right mouse button; XBox X button, PS cross button.</const>
<const name="BUTTON_3">Middle mouse button; XBox Y button, PS triangle.</const>
<const name="BUTTON_4">Alt. mouse button 1; XBox B button, PS circle.</const>
<const name="BUTTON_5">Alt. mouse button 2.</const>
<const name="BUTTON_6">Non-specific button assignment.</const>
<const name="BUTTON_7">Non-specific button assignment.</const>
<const name="BUTTON_8">Non-specific button assignment.</const>
<const name="BUTTON_9">Non-specific button assignment.</const>
<const name="BUTTON_SELECT">Gamepad select button - value is 0 or 1.</const>
<const name="BUTTON_START">Gamepad start button - value is 0 or 1.</const>
<const name="CROSSED_IN">This message is sent by the input system when the mouse pointer enters an area for the first time. The message value refers to the object ID of the container being monitored for movement.</const>
<const name="CROSSED_OUT">This message is sent by the input system when the mouse pointer leaves an area. The message value refers to the object ID of the container being monitored for movement.</const>
<const name="DEVICE_TILT_XY">Controller tilted on the X/Y axis. Value indicates angle, -ve = left, +ve = right</const>
<const name="DEVICE_TILT_Z">Controller is rising or falling. Value expressed as 'speed',</const>
<const name="DIGITAL_XY">Digital movement from a relative location. Value is +/- n, where n is the number of units moved horizontally. Mouse movement will normally exceed a value of 1, whereas gamepad movement is limited to a value of +/- 1 except in the case of successive presses.</const>
<const name="DISPLAY_EDGE">Recently supplied input occurred at the edge of the display.</const>
<const name="LEFT_BUMPER_1">Gamepad left-hand bumper 1 (top) - pressure sensitive value from 0 - 1.0.</const>
<const name="LEFT_BUMPER_2">Gamepad left-hand bumper 2 (lower) - pressure sensitive value from 0 - 1.0.</const>
<const name="PEN_TILT_XY">For pen-based input, this type indicates the vertical tilt of the pen device. A value of 0 indicates that the pen is laid flat with nib at the bottom, 0.5 is 90 degrees, 1.0 is laid flat with nib at the top.</const>
<const name="PRESSURE">Amount of pressure applied, ranges from 0 (none) to 1.0 (normal) and possibly higher if user presses hard enough</const>
<const name="RIGHT_BUMPER_1">Gamepad right-hand bumper 1 (top) - pressure sensitive value from 0 - 1.0.</const>
<const name="RIGHT_BUMPER_2">Gamepad right-hand bumper 2 (lower) - pressure sensitive value from 0 - 1.0.</const>
<const name="TRIGGER_LEFT">Gamepad left-hand trigger - value is between 0 - 1.0 (0 is released, 1.0 is fully depressed).</const>
<const name="TRIGGER_RIGHT">Gamepad right-hand trigger.</const>
<const name="WHEEL">Mouse wheel rotation - the value generally reflects the number of 'clicks' rotated on the wheel.</const>
<const name="WHEEL_TILT">Some mouse wheels can be tilted to the left or right. Ranges from -1.0 to +1.0</const>
</constants>
Expand Down
43 changes: 28 additions & 15 deletions docs/xml/modules/classes/vectorgradient.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,30 @@
</field>

<field>
<name>FX</name>
<comment>The horizontal focal point for radial gradients.</comment>
<name>Flags</name>
<comment>Dimension flags are stored here.</comment>
<access read="R" write="W">Read/Write</access>
<type lookup="VGF">VGF</type>
<description>
<p>Dimension flags that indicate whether field values are fixed or scaled are defined here.</p>
<types lookup="VGF"/>
</description>
</field>

<field>
<name>FocalRadius</name>
<comment>The size of the focal radius for radial gradients.</comment>
<access read="G" write="S">Get/Set</access>
<type>DOUBLE</type>
<description>
<p>The <code>(FX, FY)</code> coordinates define the focal point for radial gradients. If left undefined, the focal point will match the center of the gradient.</p>
<p>If a radial gradient has a defined focal point (by setting <fl>FocalX</fl> and <fl>FocalY</fl>) then the FocalRadius can be used to adjust the size of the focal area. The default of zero ensures that the focal area matches that defined by <fl>Radius</fl>, which is the standard maintained by SVG.</p>
<p>The FocalRadius value has no effect if the gradient is linear.</p>
</description>
</field>

<field>
<name>FY</name>
<comment>The vertical focal point for radial gradients.</comment>
<name>FocalX</name>
<comment>The horizontal focal point for radial gradients.</comment>
<access read="G" write="S">Get/Set</access>
<type>DOUBLE</type>
<description>
Expand All @@ -78,13 +90,12 @@
</field>

<field>
<name>Flags</name>
<comment>Dimension flags are stored here.</comment>
<access read="R" write="W">Read/Write</access>
<type lookup="VGF">VGF</type>
<name>FocalY</name>
<comment>The vertical focal point for radial gradients.</comment>
<access read="G" write="S">Get/Set</access>
<type>DOUBLE</type>
<description>
<p>Dimension flags that indicate whether field values are fixed or scaled are defined here.</p>
<types lookup="VGF"/>
<p>The <code>(FX, FY)</code> coordinates define the focal point for radial gradients. If left undefined, the focal point will match the center of the gradient.</p>
</description>
</field>

Expand All @@ -94,7 +105,7 @@
<access read="G" write="S">Get/Set</access>
<type>STRING</type>
<description>
<p>The ID field is provided for the purpose of SVG support. Where possible we would recommend that you use the existing object name and automatically assigned ID's for identifiers.</p>
<p>The ID field is provided for the purpose of SVG support. Where possible, we recommend that you use the existing object name and automatically assigned ID's for identifiers.</p>
</description>
</field>

Expand Down Expand Up @@ -136,7 +147,7 @@
<access read="G" write="S">Get/Set</access>
<type>DOUBLE</type>
<description>
<p>The radius of the gradient can be defined in fixed units or scaled terms to its container. A default radius of 50% (0.5) applies if this field is not set.</p>
<p>The radius of the gradient can be defined as a fixed unit or scaled relative to its container. A default radius of 50% (0.5) applies if this field is not set.</p>
<p>The Radius value has no effect if the gradient is linear.</p>
</description>
</field>
Expand All @@ -147,7 +158,7 @@
<access read="R" write="W">Read/Write</access>
<type lookup="VSPREAD">VSPREAD</type>
<description>
<p>Indicates what happens if the gradient starts or ends inside the bounds of the target vector. The default is <code>VSPREAD::PAD</code>.</p>
<p>Indicates what happens if the gradient starts or ends inside the bounds of the target vector. The default is <code>VSPREAD::PAD</code>. Other valid options for gradients are <code>REFLECT</code> and <code>REPEAT</code>.</p>
<types lookup="VSPREAD"/>
</description>
</field>
Expand Down Expand Up @@ -259,15 +270,17 @@
<constants lookup="VGF" comment="Gradient flags">
<const name="FIXED_CX">CX is fixed</const>
<const name="FIXED_CY">CY is fixed</const>
<const name="FIXED_FOCAL_RADIUS">Focal radius is fixed</const>
<const name="FIXED_FX">FX is fixed</const>
<const name="FIXED_FY">FY is fixed</const>
<const name="FIXED_RADIUS">is fixed</const>
<const name="FIXED_RADIUS">Radius is fixed</const>
<const name="FIXED_X1">X1 is fixed</const>
<const name="FIXED_X2">X2 is fixed</const>
<const name="FIXED_Y1">Y1 is fixed</const>
<const name="FIXED_Y2">Y2 is fixed</const>
<const name="SCALED_CX">CX is scaled</const>
<const name="SCALED_CY">CY is scaled</const>
<const name="SCALED_FOCAL_RADIUS">Focal radius is scaled</const>
<const name="SCALED_FX">FX is scaled</const>
<const name="SCALED_FY">FY is scaled</const>
<const name="SCALED_RADIUS">Radius is scaled</const>
Expand Down
Loading

0 comments on commit 2c46940

Please sign in to comment.