1
1
use super :: {
2
- c_void,
3
- ge:: { GeContext , GeCommand , GeListState } ,
4
- display:: DisplayPixelFormat ,
5
- types:: { ScePspFMatrix4 , ScePspFVector3 , ScePspIMatrix4 } ,
2
+ c_void, DisplayPixelFormat , GeCommand , GeContext , GeListState ,
3
+ ScePspFMatrix4 , ScePspFVector3 , ScePspIMatrix4 ,
6
4
} ;
7
5
6
+ pub type GuCallback = Option < extern "C" fn ( id : i32 , arg : * mut c_void ) > ;
7
+ pub type GuSwapBuffersCallback =
8
+ Option < extern "C" fn ( display : * mut * mut c_void , render : * mut * mut c_void ) > ;
9
+
8
10
pub const GU_PI : f32 = 3.141593 ;
9
11
10
12
#[ repr( u32 ) ]
@@ -411,14 +413,24 @@ pub enum ClutPixelFormat {
411
413
Psm8888 = 3 ,
412
414
}
413
415
414
- pub type GuCallback = Option < extern fn ( id : i32 , arg : * mut c_void ) > ;
415
- pub type GuSwapBuffersCallback = Option < extern fn ( display : * mut * mut c_void , render : * mut * mut c_void ) > ;
416
-
417
- extern {
416
+ extern "C" {
418
417
pub fn sceGuDepthBuffer ( zbp : * mut c_void , zbw : i32 ) ;
419
- pub fn sceGuDispBuffer ( width : i32 , height : i32 , dispbp : * mut c_void , dispbw : i32 ) ;
420
- pub fn sceGuDrawBuffer ( psm : DisplayPixelFormat , fbp : * mut c_void , fbw : i32 ) ;
421
- pub fn sceGuDrawBufferList ( psm : DisplayPixelFormat , fbp : * mut c_void , fbw : i32 ) ;
418
+ pub fn sceGuDispBuffer (
419
+ width : i32 ,
420
+ height : i32 ,
421
+ dispbp : * mut c_void ,
422
+ dispbw : i32 ,
423
+ ) ;
424
+ pub fn sceGuDrawBuffer (
425
+ psm : DisplayPixelFormat ,
426
+ fbp : * mut c_void ,
427
+ fbw : i32 ,
428
+ ) ;
429
+ pub fn sceGuDrawBufferList (
430
+ psm : DisplayPixelFormat ,
431
+ fbp : * mut c_void ,
432
+ fbw : i32 ,
433
+ ) ;
422
434
pub fn sceGuDisplay ( state : bool ) -> bool ;
423
435
pub fn sceGuDepthFunc ( function : DepthFunc ) ;
424
436
pub fn sceGuDepthMask ( mask : i32 ) ;
@@ -446,9 +458,16 @@ extern {
446
458
pub fn sceGuCallList ( list : * const c_void ) ;
447
459
pub fn sceGuCallMode ( mode : i32 ) ;
448
460
pub fn sceGuCheckList ( ) -> i32 ;
449
- pub fn sceGuSendList ( mode : GuQueueMode , list : * const c_void , context : * mut GeContext ) ;
461
+ pub fn sceGuSendList (
462
+ mode : GuQueueMode ,
463
+ list : * const c_void ,
464
+ context : * mut GeContext ,
465
+ ) ;
450
466
pub fn sceGuSwapBuffers ( ) -> * mut c_void ;
451
- pub fn sceGuSync ( mode : GuSyncMode , behavior : GuSyncBehavior ) -> GeListState ;
467
+ pub fn sceGuSync (
468
+ mode : GuSyncMode ,
469
+ behavior : GuSyncBehavior ,
470
+ ) -> GeListState ;
452
471
pub fn sceGuDrawArray (
453
472
prim : GuPrimitive ,
454
473
vtype : i32 ,
@@ -478,7 +497,12 @@ extern {
478
497
pub fn sceGuLightAtt ( light : i32 , atten0 : f32 , atten1 : f32 , atten2 : f32 ) ;
479
498
pub fn sceGuLightColor ( light : i32 , component : i32 , color : u32 ) ;
480
499
pub fn sceGuLightMode ( mode : LightMode ) ;
481
- pub fn sceGuLightSpot ( light : i32 , direction : & ScePspFVector3 , exponent : f32 , cutoff : f32 ) ;
500
+ pub fn sceGuLightSpot (
501
+ light : i32 ,
502
+ direction : & ScePspFVector3 ,
503
+ exponent : f32 ,
504
+ cutoff : f32 ,
505
+ ) ;
482
506
pub fn sceGuClear ( flags : i32 ) ;
483
507
pub fn sceGuClearColor ( color : u32 ) ;
484
508
pub fn sceGuClearDepth ( depth : u32 ) ;
@@ -500,7 +524,12 @@ extern {
500
524
dest_fix : u32 ,
501
525
) ;
502
526
pub fn sceGuMaterial ( components : i32 , color : u32 ) ;
503
- pub fn sceGuModelColor ( emissive : u32 , ambient : u32 , diffuse : u32 , specular : u32 ) ;
527
+ pub fn sceGuModelColor (
528
+ emissive : u32 ,
529
+ ambient : u32 ,
530
+ diffuse : u32 ,
531
+ specular : u32 ,
532
+ ) ;
504
533
pub fn sceGuStencilFunc ( func : StencilFunc , ref_ : i32 , mask : i32 ) ;
505
534
pub fn sceGuStencilOp (
506
535
fail : StencilOperation ,
@@ -529,10 +558,21 @@ extern {
529
558
pub fn sceGuTexFilter ( min : TextureFilter , mag : TextureFilter ) ;
530
559
pub fn sceGuTexFlush ( ) ;
531
560
pub fn sceGuTexFunc ( tfx : TextureEffect , tcc : TextureColorComponent ) ;
532
- pub fn sceGuTexImage ( mipmap : MipmapLevel , width : i32 , height : i32 , tbw : i32 , tbp : * const c_void ) ;
561
+ pub fn sceGuTexImage (
562
+ mipmap : MipmapLevel ,
563
+ width : i32 ,
564
+ height : i32 ,
565
+ tbw : i32 ,
566
+ tbp : * const c_void ,
567
+ ) ;
533
568
pub fn sceGuTexLevelMode ( mode : TextureLevelMode , bias : f32 ) ;
534
569
pub fn sceGuTexMapMode ( mode : TextureMapMode , a1 : u32 , a2 : u32 ) ;
535
- pub fn sceGuTexMode ( tpsm : TexturePixelFormat , maxmips : i32 , a2 : i32 , swizzle : i32 ) ;
570
+ pub fn sceGuTexMode (
571
+ tpsm : TexturePixelFormat ,
572
+ maxmips : i32 ,
573
+ a2 : i32 ,
574
+ swizzle : i32 ,
575
+ ) ;
536
576
pub fn sceGuTexOffset ( u : f32 , v : f32 ) ;
537
577
pub fn sceGuTexProjMapMode ( mode : TextureProjectionMapMode ) ;
538
578
pub fn sceGuTexScale ( u : f32 , v : f32 ) ;
@@ -541,7 +581,12 @@ extern {
541
581
pub fn sceGuTexSync ( ) ;
542
582
pub fn sceGuTexWrap ( u : GuTexWrapMode , v : GuTexWrapMode ) ;
543
583
pub fn sceGuClutLoad ( num_blocks : i32 , cbp : * const c_void ) ;
544
- pub fn sceGuClutMode ( cpsm : ClutPixelFormat , shift : u32 , mask : u32 , a3 : u32 ) ;
584
+ pub fn sceGuClutMode (
585
+ cpsm : ClutPixelFormat ,
586
+ shift : u32 ,
587
+ mask : u32 ,
588
+ a3 : u32 ,
589
+ ) ;
545
590
pub fn sceGuOffset ( x : u32 , y : u32 ) ;
546
591
pub fn sceGuScissor ( x : i32 , y : i32 , w : i32 , h : i32 ) ;
547
592
pub fn sceGuViewport ( cx : i32 , cy : i32 , width : i32 , height : i32 ) ;
0 commit comments