| Rapid-Q Documentation by William Yu (c)1999, appended by John Kelly | Appendix B: QDXSCREEN |
| Field | Type | R/W | Default |
| Align | INTEGER | RW | alNone |
| AllowStretch | INTEGER | RW | True |
| AutoSize | INTEGER | RW | True |
| BitCount | INTEGER | RW | 8 |
| Color | INTEGER | RW | |
| Cursor | INTEGER | RW | crDefault |
| Enabled | INTEGER | RW | True |
| Font | QFONT | W | |
| See QFont |
FONT.BOLD FONT.COLOR FONT.FONTNAME FONT.NAME FONT.HANDLE FONT.SIZE FONT.CHARSET FONT.ADDSTYLES FONT.PITCH FONT.DELSTYLES FONT.ITALIC FONT.FONTCOUNT FONT.UNDERLINE FONT.STRIKEOUT |
||
| FullScreen | INTEGER | RW | False |
| FullScreen = True, and make sure your form border style is bsNone. If you don't it will temporarily change the screen resolution. QDXScreen allows faster graphics than a QCANVAS because of direct writing to video memory. You can have menus, buttons, etc. with a DXscreen fullscreen **but** you must specify qdxscreen.fullScreen = True before you do Form.ShowModal. Once you are in fullscreen mode, you can't toggle back to non-fullscreen mode until the program ends. | |||
| Height | INTEGER | RW | |
| Hint | STRING | RW | |
| Left | INTEGER | RW | |
| Parent | QFORM/QPANEL/QTABCONTROL The screen can be rapidly moved to another form by changing its Parent | W | |
| Pixel | 2D ARRAY of INTEGER This reads/writes color information to the screen. There is not the way to get the memory pointer of the screen buffer | RW | |
| ShowHint | INTEGER | RW | False |
| Top | INTEGER | RW | |
| Use3D | INTEGER | RW | False |
| UseHardware | INTEGER (hardware acceleration, always try to use this) | RW | True |
| Visible | INTEGER | RW | True |
| Width | INTEGER | RW | |
| Method | Type | Description | Params |
| Circle | SUB (x1%, y1%, x2%, y2%, c%, fill%) | Draw & Fill Circle | 6 |
| CopyRect | SUB (D, Image, S) | D and S are QRECTs, Image can be a QImage, QCanvas, or QBitmap | 3 |
| Draw | SUB (x%, y%, BMP) | Draw Bitmap at (X,Y) | 3 |
| FastPset | SUB (X1%, Y1%, C%) not fully implemented? | Direct write pixel at x, y | 3 |
| Fill | SUB (Color%) | Fill screen with color with BGR code (&HFF = Blue, &HFF00 = Green, &HFF0000 = Red) | 1 |
| FillRect | SUB (x1%, y1%, x2%, y2%, c%) | Draw & Fill a rectangle | 5 |
| Flip | SUB | Copies off-screen buffer to visible page, always flip to see it | 0 |
| Init | SUB (Width%, Height%) | Create Screen | 2 |
| Line | SUB (x1%, y1%, x2%, y2%, c%) | Draws a line | 5 |
| Paint | SUB (x%, y%, c%, borderc%) | Fill Region | 4 |
| Pset | SUB (x%, y%, c%) | Pixel Plot | 3 |
| Rectangle | SUB (x1%, y1%, x2%, y2%, c%) | Draws a rectangle | 5 |
| Release | SUB | Force update | 0 |
| Rotate | SUB (xOrigin%, yOrigin%, Angle%) | Rotates entire screen at specified origin | 3 |
| RoundRect | SUB (x1%, y1%, x2%, y2%, x3%, y3%, c%) | Draws & Fills a rounded rectangle | 7 |
| StretchDraw | SUB (Rect AS QRECT, BMP) | Draw BMP and stretch to fit inside Rect | 2 |
| TextHeight | FUNCTION (Text$) AS WORD | Returns the height, in pixels, of Text$ string | 1 |
| TextWidth | FUNCTION (Text$) AS WORD | Returns the width, in pixels, of Text$ string | 1 |
| TextRect | SUB (Rect AS QRECT, x%, y%, S$, fc%, bc%) | Write text, and clip within region Rect | 6 |
| TextOut | SUB (x%, y%, S$, fc%, bc%) | Writes text | 5 |
| Method | Type | Description | Params |
| AddLight | SUB (Light AS QD3DLight) | Add light to scene | 1 |
| CameraLookAt | SUB (F AS QD3DFrame, Constraint AS INTEGER) | Fix frame and constrain rotation | 2 |
| CreateFace | SUB (Face AS QD3DFace) | Creates a face | 1 |
| CreateFrame | SUB (Frame AS QD3DFrame) | Creates frame | 1 |
| CreateLightRGB | SUB (LightType%, R#, G#, B#, Light AS QD3DLight) | Create light object | 5 |
| CreateMeshBuilder | SUB (MB AS QD3DMeshBuilder) | Creates meshbuilder | 1 |
| CreateShadow | SUB (MB AS QD3DMeshBuilder, Light AS QD3DLight, px#, py#, pz#, nx#, ny#, nz#, V AS QD3DVisual) | Creates a visual shadow object | 9 |
| CreateWrap | SUB (WrapType%, A#, B#, C#, D#, E#, F#, G#, H#, I#, J#, K#, L#, M#, W AS QD3DWrap) | Creates a wrap object | 15 |
| ForceUpdate | SUB (X1%, Y1%, X2%, Y2%) | Force update on specific region | 4 |
| LoadTexture | SUB (File AS STRING, Tex AS QD3DTexture) | Create a texture object | 2 |
| Move | SUB (D AS DOUBLE) | Moves/animates scene (Quaterion operation) | 1 |
| SetBackgroundImage | SUB (Tex AS QD3DTexture) | Set background image for scene | 1 |
| SetCameraPosition | SUB (X#, Y#, Z#) | Set camera position for entire scene | 3 |
| SetCameraOrientation | SUB (DX#, DY#, DZ#, UX#, UY#, UZ#) The camera.is a hidden QD3DFrame. DX,DY, DZ range from -1 to 1 set left-right vs up- down. UX, UY, range from -1 to 1 and set the roll (set UZ = 1; it has no effect) | Set camera orientation for scene | 6 |
| SetRenderMode | SUB (M AS INTEGER) | Set render mode for scene | 1 |
| SetVelocity | SUB (X#, Y#, Z#, R%) Undocumented should
affect QDXSCREEN.MOVE(), QD3DFRAME.MOVE() | set rotation velocity of a Quaterion operation | 6 |
| SetTextureQuality | SUB (Quality AS INTEGER) | Set texture quality for scene | 1 |
| VIEW.CLEAR | SUB () e.g., QDXScreen.View.Clear | ‘clears the DXSCREEN | 0 |
| VIEW.GETFRONT | FUNCTION () AS SINGLE | ‘gets the front clipping plane | 0 |
| VIEW.SETFRONT | SUB (RVFRONT AS SINGLE) i.e., DIM a as SINGLE a = QDXSCREEN.VIEW.GETFRONT QDXSCREEN.VIEW.SETFRONT(a + 10) ‘ render less | ‘ set front clipping plane | 1 |
| VIEW.GETBACK | FUNCTION () AS SINGLE | ‘gets the back clipping plane | 0 |
| VIEW.SETBACK | SUB (RVBACK AS SINGLE) 'default back is 5000 | ‘gets the front clipping plane | 1 |
| VIEW.SETPLANE | SUB ((LEFT#, RIGHT#, BOTTOM#, TOP#) | ‘sets the front clipping plane of the viewing frustum
with the coordinates of the four sides, relative to the camera's z-axis. Changes the 3D perspective | 4 |
| Event | Type | Occurs when... | Params |
| OnClick | VOID | Mouse button clicked | 0 |
| OnDblClick | VOID | Mouse button double clicked | 0 |
| OnInitialize | VOID | DirectX succeeds in initializing | 0 |
| OnInitializeSurface | VOID | Another event for you to do initializing | 0 |
| You must wait for QDXScreen surface to initialize before drawing on it. | |||
| OnKeyDown | SUB (Key AS Word, Shift AS INTEGER) | Key held down | 2 |
| OnKeyPress | SUB (Key AS BYTE) | User presses a key | 1 |
| OnMouseDown | SUB (Button%, X%, Y%) | Mouse button held down | 3 |
| OnMouseMove | SUB (X%, Y%) | Mouse moves | 2 |
| OnMouseUp | SUB (Button%, X%, Y%) | Mouse button is released | 3 |
$TYPECHECK ON
$INCLUDE "RAPIDQ.INC"
DECLARE SUB DrawOnScreen
DIM TheBMP AS QBITMAP
CREATE Form AS QForm
ClientHeight = 480
ClientWidth = 640
CREATE QScreen AS QDXScreen
BitCount = 24
width = Form.ClientWidth
height = Form.ClientHeight
Init(640, 480) 'define its memory, can be larger than visible screen
OnClick = DrawOnScreen
' OnInitialize = DrawOnScreen'will clear..
END CREATE
END CREATE
Form.ShowModal
SUB DrawOnScreen(Sender AS QDXScreen)
TheBMP.LoadFromFile("test.bmp")
QScreen.Draw(0,0, TheBMP.BMP) 'draw a picutre on it
QScreen.Line(0,0,200,200,&HFF) 'draw a red line on picture
QScreen.Flip 'need this for each new drawing
END SUB
| Prev Component | Contents | Next Component |