Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
58 user(s) are online (29 user(s) are browsing Forums)

Members: 1
Guests: 57

BSzili, more...

Headlines

Forum Index


Board index » All Posts (AmiDARK)




Re: GCC, Switch( condition ) & Case
Quite a regular
Quite a regular


@Gazelle
In fact, I've made it slightly different now:
switch( Depth ){
      case 
8:
        
DMode GLUT_DOUBLE GL_COLOR_INDEX;
        break;
      case 
16/* for now fall through */
      
case 24:
        
DMode GLUT_DOUBLE GLUT_RGB GLUT_DEPTH;
        break;
      case 
32:
        
DMode GLUT_DOUBLE GLUT_RGBA GLUT_DEPTH;
        break;
      default:
        
DMode GLUT_DOUBLE GLUT_RGB GLUT_DEPTH;
     }

All we have to decide is what to do with the time that is given to us.
Go to top


Re: GCC and boolean ....
Quite a regular
Quite a regular


@abalaban:
Effectively, it's a good advice :)

All we have to decide is what to do with the time that is given to us.
Go to top


Re: GCC, Switch( condition ) & Case
Quite a regular
Quite a regular


@Gazelle
Effectively, second = added :p

I must not simplify cos, if some more modes are added to glut to handle RGB32, RGB24, RGB16 and color index 8 bits, I want to have just to add the correct flag to make my display mode use them.

All we have to decide is what to do with the time that is given to us.
Go to top


Re: GCC, Switch( condition ) & Case
Quite a regular
Quite a regular


@xeron
I suspected that.
Thank you.

All we have to decide is what to do with the time that is given to us.
Go to top


GCC, Switch( condition ) & Case
Quite a regular
Quite a regular


Hi,

I encounter an error on using SWITCH/CASE C/C++ commands under GCC ... I don't understand why because I think I use correctly the functions :

Here is the error :
setup.c:104:error: expected expression before 'default'

Here is the code :
/* Cr?ation de la fen?tre d'affichage principale */
void SetDisplayModeint Widthint Heightint Depth ){                    /* TO DO : MUST ADDED WITH TO InitDisplayMode */
  
BOOL Supported;
  
int DMode;
  
Supported CheckDisplayModeWidthHeightDepth );
  if ( 
Supported TRUE ){
    
/* Open the screen using windowed mode */
    
switch( Depth ){
      case 
32:
        
DMode GLUT_DOUBLE GLUT_RGB GLUT_DEPTH
      
case 24:
        
DMode GLUT_DOUBLE GLUT_RGB GLUT_DEPTH
      
case 16:
        
DMode GLUT_DOUBLE GLUT_RGB GLUT_DEPTH
      
case 8:
        
DMode GLUT_DOUBLE GL_COLOR_INDEX
      
case default:
        
DMode GLUT_DOUBLE GLUT_RGB GLUT_DEPTH
     
}
    
glutInitDisplayModeDMode );              /* Define display mode properties */
    
glutInitWindowSizeWidthHeight );
    
glutInitWindowPosition3232 );
    
WindowID glutCreateWindow"AmiDARK Basic application" ); /* Create the asked window */
    
if (FullSCREEN == TRUE ){
      
glutGameModeString"640x480:32" );
      
glutEnterGameMode();
     }
   }
 }


Strange. not ?
Or I am wrong again ?

EDIT :
Forget, I've found the error ... default does not need "case" before ... :p


Edited by freddix on 2009/2/22 23:53:06
All we have to decide is what to do with the time that is given to us.
Go to top


Re: GCC and boolean ....
Quite a regular
Quite a regular


@MichaelMerkel
Ok
Thank you for these advices.

All we have to decide is what to do with the time that is given to us.
Go to top


Re: GCC and boolean ....
Quite a regular
Quite a regular


@ssolie
Quote:

if (IsFullScreen) // best

Then you prefer IsFullScreen as bool to handle fullscreen mode state ?

All we have to decide is what to do with the time that is given to us.
Go to top


Re: GCC and boolean ....
Quite a regular
Quite a regular


@thomas
Ok

Now my dev work perfectly :)
Will add new functions :p

All we have to decide is what to do with the time that is given to us.
Go to top


Re: MiniGL - Switch mode : fullscreen & windowed
Quite a regular
Quite a regular


@BillE
MiniGL 2.0 should be released when the Hyperion website will be back online.
(it's what Hans said on an other post I've made on amigans.net).
You should then get these files soonly.

All we have to decide is what to do with the time that is given to us.
Go to top


Re: GCC and boolean ....
Quite a regular
Quite a regular


@salass00
Effectively,
I've re-read my C book and if comparizon need == instead of simple =.

Thank you.

All we have to decide is what to do with the time that is given to us.
Go to top


GCC and boolean ....
Quite a regular
Quite a regular


Hi All,

I encounter a small issue using boolean.
Here is my code :

1st part, the main C project :
#include <gl/glut.h>

int argc;
char** argv;

#include "setup.c"
#include "camera.c"
#include "core.c"

int mainint argcchar** argv ){
  
Constructor();
  
SetDisplayMode640480 );
  
Destructor();
  return 
0;
 }


And now, part of setup.c file :
/* Variables globales au fichier lib */
BOOL FullSCREEN;
int WindowID;

/* Procedure d'initialisation de la lib DISPLAY */
void Constructorvoid ){
  
FullSCREEN FALSE;
  
glutInit( &argcargv );                                       /* Initialize Glut */
/*  glutDisplayFunc( DisplayFunc ); */
/*  glutReshapeFunc( ReshapeFunc ); */
 
}

/* Procedure de la fermeture de la librairie DISPLAY */
void Destructorvoid ){
  
glutDestroyWindowWindowID );
 }

/* Cr?ation de la fen?tre d'affichage principale */
void SetDisplayModeint Widthint Height ){                    /* TO DO : MUST ADDED WITH TO InitDisplayMode */
  /* Open the screen using windowed mode */
  
glutInitDisplayModeGLUT_DOUBLE GLUT_RGBA );              /* Define display mode properties */
  
glutInitWindowSizeWidthHeight );
  
glutInitWindowPosition3232 );
  
WindowID == glutCreateWindow"AmiDARK Basic application" ); /* Create the asked window */
  
if (FullSCREEN TRUE){
    
glutGameModeString"640x480:32" );
    
glutEnterGameMode();
   }
 }


When I compile the main C file, it compiles correctly but, when I run it, it open a window and jump in fullscreen mode. It shouldn't jump in fullscreeen mode.
if I change in the SetDisplayMode() function, this line :
if (FullSCREEN TRUE){

with :
if (FullSCREEN FALSE){

then it run, open a window and quit correctly without using full screen mode...
Why does boolean act this way ? it should work as opposite than this . not ?

Kindest Regards,
Freddix

All we have to decide is what to do with the time that is given to us.
Go to top


Re: MiniGL - Switch mode : fullscreen & windowed
Quite a regular
Quite a regular


@Hans
ok.
Thank you.

All we have to decide is what to do with the time that is given to us.
Go to top


Re: MiniGL - Switch mode : fullscreen & windowed
Quite a regular
Quite a regular


@Hans
Thank you Hans

If course, FullSCREEN is declared as global :
int FullSCREEN;

All we have to decide is what to do with the time that is given to us.
Go to top


MiniGL - Switch mode : fullscreen & windowed
Quite a regular
Quite a regular


Hi,

I'd like to know how we can, as simple as possible switch from these 2 modes at anytime in an OpenGL/MiniGL application ?

Can I do something like this :
/* Sauter en mode plein ?cran */
void SetFullScreenMode(){
  if (
FullSCREEN 0){
    
glutGameModeString"640x480:32" );
    
glutEnterGameMode();
    
FullSCREEN == 1;
   }
 }

/* Sauter en mode fen?tr? */
void SetWindowMode(){
  If (
FullSCREEN ){
    
glutLeaveGameMode() ;
    
FullSCREEN == 0;
   }
 }


and call SetFullScreenMode to jump in fullscreen mode and SetWindowMode to jump in windowed mode ?

Kindest Regards,
Freddix.

All we have to decide is what to do with the time that is given to us.
Go to top


Re: http://www.hyperion-entertainment.biz/ ???
Quite a regular
Quite a regular


@Mason
Sooner than now ? ... not possible :p

All we have to decide is what to do with the time that is given to us.
Go to top


http://www.hyperion-entertainment.biz/ ???
Quite a regular
Quite a regular


Hi All,
does someone have any information concerning the Hyperion website ?
Few days ago a page appeared requesting user/pass now. It's directly a windows popup requesting for user
It mention that it is under "test phase" ..

Any informations ?

Thanks
Fred

All we have to decide is what to do with the time that is given to us.
Go to top


Re: OpenGL - Small Stars scroll 4 layers.
Quite a regular
Quite a regular


@Hans
Ok.
I understand.

All we have to decide is what to do with the time that is given to us.
Go to top


Re: OpenGL - Small Stars scroll 4 layers.
Quite a regular
Quite a regular


@Hans :
Quote:
GlFlush() causes your program to wait until the graphics card/driver has finished processing all the commands that you just gave it. It's usually not needed. You would use it only if you want to read back the image that you've just drawn in order to use it for something (e.g., as a reflection map).

Can we render the 3D in something else than a window ? (a texture for example, this could be better for future shader use)

@Samurai_Crow:
Thank you for this link, now I understand how the function work. It work now how I expected.

All we have to decide is what to do with the time that is given to us.
Go to top


Re: OpenGL - Small Stars scroll 4 layers.
Quite a regular
Quite a regular


Ok Hans and Shadow.
Thank you.

@Shadow : I tried this without success ... nothing appear on screen ...
Is there a precise moment to display the text ?


Edited by freddix on 2009/2/16 23:53:40
All we have to decide is what to do with the time that is given to us.
Go to top


Re: OpenGL - Small Stars scroll 4 layers.
Quite a regular
Quite a regular


@Hans
Ok.
Thank you.

I think I've understood the principle of refreshing the display now.
I'll take a look at animations ...

As I'm beginner on C/C++, I didn't found how to convert an integer into a string, because I'd like to display debug informations during my dev tests such as frame rate, etc ...
Do you have any info ?

All we have to decide is what to do with the time that is given to us.
Go to top



TopTop
« 1 ... 29 30 31 (32) 33 34 35 ... 37 »




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project