XGL Programmer's Guide
この本のみを検索
PDF 文書ファイルをダウンロードする

............................Contents


Preface
xxix

New Features
xxxiii

1. Introduction to XGL
1
...Overview of XGL Functionality 1
......Direct Graphics Access 4
...Introduction to XGL Objects and Graphical Organization 6
......System State Object and Generic Operators 7
......Device Object 8
......2D and 3D Context Objects 9
......Color Map Object 10
......Transform Object 10
......Line Pattern Object 11
......Light Object 12
......Stroke Font Object 13
......Marker Object 13
......Pcache Object 13
......Gcache Object 14
......Texture Map Object and MipMap Texture Object 14

2. Installation Issues
15
...About the XGL Directory Structure 15
......Font Files 17
......XGL AnswerBook Directory Structure 18
...Setting XGL Environment Variables 18
...Verifying the Installation of XGL 19
...Installation and System Administrator Notes 19
......Debuggable XGL Runtime Library 19
......XGL Library and Reference Pipelines 20
......XGL and the PEXLib Library 20
......Solaris Security Feature and DGA 20
...Using the Solaris XGL AnswerBook 21
...Accessing the XGL Man Pages 21

3. Getting Started with XGL Programming
23
...Compiling and Running XGL Programs 23
......Run-time Considerations 25
......Using make(1) To Build XGL Example Programs 26
...Basic XGL Concepts 27
......XGL and the X Window System Environment 27
......How an XGL Application Works 30
......XGL Drawing Primitives 31
......Handling 2D and 3D Data 32
......More on XGL Object-Based Programming 34
...Example Program 37
......Creating the Window and Registering Callback Procedures 41
......Opening XGL 41
......Creating a Window Raster Device Object 41
......Creating a Context Object 42
......Rendering Geometry 42
...Objects Provided at XGL Initialization 43
...Programming Tips 44
......General Tips 44
......XView Tips 45
......OLIT Tips 46

4. System State Information and Generic Operators
47
...Introduction to the System State Object 47
...System State Operators 47
...System State Attributes 48
...Error Detection and Reporting 49
......Error Notification Function 50
......Error Types and Categories 51
...Generic XGL Operators 53

5. Devices
57
...Introduction to Device Objects 57
...Creating Device Objects 58
......Window Raster Device Object 59
......Stream Device Object 61
...Raster Object Attributes 62
......General Raster Attributes 62
......Window Raster Attributes 65
......Memory Raster Attributes 68
...CGM Device Object 70
......Creating a CGM Device 70
......Creating a Picture 72
......CGM Metafile Device Attributes 73
......XGL CGM Line Patterns 75
......XGL CGM Markers 76
...Important Notes on Integrating XGL with a Windowing System 77
......Mixing XGL and Xlib Drawing Routines 77
......Window Resize Events 78
...Device Example Programs 78
......XGL and Xlib 79
......XGL and the XView Toolkit 83
......XGL and the OLIT Toolkit 87
...Transparent Overlay Windows 90
......Creating an Overlay Window 90
......Rendering to an Overlay Window 94
...Determining Device Acceleration 97
......Inquire Example Program 99

6. Color
105
...Introduction to XGL Color 105
......Indexed Color Space 106
......RGB Color Space 106
......XGL Color Pipeline 106
...Introduction to the Color Map Object 108
...Creating a Color Map Object 108
...Color Tables 109
......Color Table Attributes 109
......Creating a Color Table 110
......Simple Color Table Example 111
...Color Table Ramps 114
......Creating Color Table Ramps 114
......Color Ramp Example 116
...Color Mapping 119
...Color Cubes 120
......Color Cube Example 121
...Dithering 124
...Using the Window System Color Map 124
...Color Map Double Buffering 126
......Color Map Double Buffering Example 126

7. Contexts
133
...Introduction to the XGL Context Object 133
...Creating a Context Object 134
...Context Object Operators 136
...Context Stacks 138
...Environment Context Attributes 138
......Context Attributes for Picking 140
......Context Attributes Associated with the View Model 141
......Context Attributes Associated with Lighting 141

8. Primitives and Graphics Context Attributes
143
...Introduction to XGL Drawing Primitives 143
......Description of Drawing Primitives 147
...Drawing Primitive Data Structures 151
......Point Types 151
......Point Lists 151
......Bounding Boxes 152
......Facet Structures 156
...Annotated Primitives 157
...Graphics Context Attributes 159
......General Rendering Attributes 160
......Context Accumulation Buffer Attributes 161
......Hidden Line/ Hidden Surface Removal (HLHSR) 162
......Context Line Attributes 163
......Context Marker Attributes 164
......Context Curve Attributes 165
......Context Surface Attributes 165
......Context Stroke Text Attributes 172
......Context Annotation Text Attributes 173
......Context View and Transform Attributes 174
......Context Paint Attributes 175
...Example Programs using XGL Primitives 178
......Polygon Example Program 178
......Rectangle Example Program 180
......Circle Example Program 183
...Raster Level Primitives 187
......Getting and Setting Pixel Values 187
......Copying Buffer Contents 187
...Raster Primitive Example Programs 189
......Example Program for Getting and Setting Pixels 189
......Example Program for Copying Pixels 191
...Accumulation Buffer 196
......Accumulation Operator 197
......Accumulation Attributes 199
......Accumulation Example 199

9. Rendering NURBS Curves and Surfaces with XGL
203
...Introduction to NURBS Curves and Surfaces 203
...NURBS Curves 204
......Mathematical Description of a NURBS Curve 204
......Rendering a NURBS Curve 207
......NURBS Curve Attributes 208
......Color Splines 211
...Curve Example Programs 211
......Bezier Curve Example Program 211
......Circle Curve Example Program 216
...NURBS Surfaces 221
......Mathematical Description of a NURBS Surface 221
......Rendering a NURBS Surface 223
......Surface Trimming 224
......Performance Hints for Simple Geometry 227
......NURBS Surface Attributes 228
......Color Surfaces 232
......Displaying Silhouettes on NURBS Surfaces 232
...Surface Example Program 233
...Using Geometry Cache for Curve and Surface Rendering 238
...Getting the Best Out of XGL NURBS 239

10. Transforms
241
...Introduction to the Transform Object 241
...Creating a Transform Object 242
...Transform Operators 242
......Rotation Operator 243
......Scaling Operator 244
......Translation Operator 244
......Reading and Writing Transforms 245
......Other Transform Operators 247
...Transform Attributes 250
...Examples Using the Transform Object 250
......2D Transform Examples 250
......3D Transform Example 260

11. View Model
265
...Introduction to the XGL Viewing Pipeline 265
......Coordinate Systems 266
...How to Use Transforms with the View Model 270
...Using XGL 2D and 3D Viewing 271
......Model Coordinate Space and Model Transforms 271
......World Coordinate Space and the View Transform 272
......Virtual Device Coordinate Space and the VDC Transform 273
......MC-to-DC Transform 276
......Model Clipping in 3D 277
......View Clipping 278
...View Example Program 279
......Usage Note 280

12. Stroke Text
287
...Introduction to the Stroke Font Object 287
...Fonts Provided by XGL 288
...Creating a Stroke Font Object 289
...Rendering Stroke Fonts 290
......Rendering Stroke Text 291
......Rendering Annotation Text 291
......Single String and Multiple String Rendering 292
...Stroke Font Attributes 294
...Context Stroke Text Attributes 295
......Character Height 295
......Character Expansion Factor 296
......Character Spacing 296
......Character Up Vector 297
......Character Slant Angle 297
......Text Path 298
......Text Alignment 299
......Text Color 301
......Text Precision 301
......Stroke Text Character Encoding 302
...Context Annotation Text Attributes 302
......Annotation Text Style 303
...Determining the Text Extent 303
...Text Encoding Schemes 305
...Stroke Font Example Program 308

13. Line Patterns
315
...Introduction to the Line Pattern Object 315
...Using the Predefined Line Patterns 316
...Creating a Line Pattern Object 317
...Defining a New Line Pattern 318
...Line Pattern Attributes 319
...Context Line Pattern Attributes 321
......Line Rendering with a Line Pattern 321
......Setting Line Color 322
......Edge Rendering with a Line Pattern 323
......Setting Edge Color 324
...Line Pattern Examples 324
......Patterned Line Example 324
......Line Pattern Polygon Edge Example 328

14. Markers
333
...Introduction to the Marker Object 333
...Using the Predefined Markers 334
...Creating a New Marker 335
...Context Marker Attributes 336
...Marker Example Programs 337
......Predefined Marker Example Program 337
......User-defined Marker Example Program 340

15. Picking
345
...Introduction to XGL Picking 345
...Picking Attributes 346
...XGL Picking Operators 348
......Clearing the Pick Buffer 348
......Identifying Picked Primitives 348
...Picking Example 349

16. Lighting, Shading, and Depth Cueing
355
...Introduction to the 3D Rendering Pipeline 355
......Lighting 355
......Shading 356
......Depth Cueing 356
......Surface Primitives 357
......The 3D Context in Lighting 357
...Basic Lighting and Shading Concepts 357
......Colors 357
......Reflection Components 358
......Light Sources 359
......Illumination and Shading 359
...Lighting Equations 360
......RGB Lighting 363
......Indexed Lighting 364
......XGL Lighting Attributes 366
...Creating a Light Object 367
...Light Operators and Attributes 369
......Light Operator 369
......Light Attributes 369
......3D Context Attributes for Lighting 370
...Depth Cueing 371
......Applications 371
......Linear Depth Cueing 372
......Scaled Depth Cueing 372
......Depth Cueing Attributes 373
...Lighting Examples 375
......Light Facet Example 375
......Light Vertex Example 380
......Linear Depth Cueing Example 382
......Scaled Depth Cueing Example 385

17. Caching Geometry
389
...Introduction to Geometry Caching in XGL 389
...Pcache Object 390
......Using Pcache Objects With Immediate Mode Applications 391
......Pcache Performance Considerations 392
......Creating and Rendering to a Pcache 392
......Displaying a Pcache 394
...Gcache Object 396
......When To Use a Gcache 396
......Creating a Gcache 397
......Rendering to a Gcache 397
......Gcache Attributes 399
......Displaying the Gcache 403
......Gcache Example Programs 404

18. Texture Mapping
409
...Overview of Texture Mapping 409
......MIP Maps 410
......Multiple Textures 410
...How Texture Mapping Works in XGL 411
......Overview Steps for Mapping a Texture to a Surface 411
...Defining the Texture Data 412
......Letting XGL Build the Mip Map 412
......Using an Application-Supplied MIP Map 417
......Additional MipMap Texture Attributes 417
...Specifying the Properties of the Texture 418
......Specifying Texture Properties with the Texture Map Object 419
......Associating the Texture Map Object with a 3D Context 427
......Additional Texture Map Attributes 427
......Specifying Texture Properties with the Data Map Texture
........Object 429
......Associating the Data Map Texture Object with a 3D Context 433
......Additional Data Map Texture Attributes 433
...Mapping the Texture to a Surface Primitive 435
......Using Data Point Types for Texture Mapping 435
...Texture Mapping Example Program 438

A. Changes to the XGL Library
449
...Changed Operators 449
...New Attributes 450
...Deleted Attributes 451
...New Data Structures 452
...Changed Data Structures 453

B. Software Rendering Characteristics
455
...Antialiasing 455
...Transparency 457

C. The Utility and Main Example Programs
459
......ex_utils.c 459
......color_ccube_main.c 471
......color_main.c 472
......copy_raster_main.c 474
......dcue_main.c 474
......gcache_main.c 476
......gspixel_main.c 477
......light_main.c 478
......lpat_main.c 480
......nurbs_main.c 481
......pick_2d_main.c 482
......prims_2d_main.c 483
......tran_main.c 484
......view_main.c 486

D. XGL Errors
493
...Device-Independent Nonrecoverable Errors 494
...Device-Independent Recoverable Errors 496
...GX Frame Buffer Errors 500
...Xlib/PEXlib Errors 500

A Glossary of XGL Terms
501

Index
511