Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
94 user(s) are online (55 user(s) are browsing Forums)

Members: 0
Guests: 94

more...

Headlines

Forum Index


Board index » All Posts (AmiDARK)




Re: GCC, Dynamic structure creation method ?
Quite a regular
Quite a regular


@freddix
no one know ?

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


Re: New version of Quake (v2.40) available
Quite a regular
Quite a regular


I always get problems with rez higher than 1024x768 on my SAM ...
More to this, it's not impossible to change display resolution during game with menus ...

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


Re: GCC, Dynamic structure creation method ?
Quite a regular
Quite a regular


@Gazelle
ok.

Now I understand how the pointer in struc works.

Thank you Gazelle.


When compiling, I also get some errors on things I'read here for example :

definition :
typedef struct Object3DType{
 ...
 };


Object3DType *Allocate3DObjectint ObjectID ){
  ...
 }

Basic3D.c:48: error: expeted '=', ',', ';', 'asm' or '__attribute__' before '*' token

and

void Free3DObjectObject3DType *OldObject ){
 ...
 }

Basic3D.c:71: error: expected ')' before '*' token

Why ? I use exactly what was adviced to me here in this post ...

Kindest Regards,
Freddix


Edited by freddix on 2009/3/1 10:55:00
All we have to decide is what to do with the time that is given to us.
Go to top


Re: GCC, Dynamic structure creation method ?
Quite a regular
Quite a regular


I encounter another problem with structures.
I've made this with the book help :

struct Basic3DStructType{
  
int *LastCreatedObject;
 };
struct Basic3DStructType Basic3D;

struct Object3DType{
  
int *PreviousObject, *NextObject;
 };

void BASIC3D_Destructorvoid ){
  
struct ObjectType *NewObject Basic3D.LastCreatedObject;
   
struct Object3DType *NextToDelete NewObject.PreviousObject;
 }


I've removed other lines to just show what is wrong ...
I get an error on this line :
Quote:
struct Object3DType *NextToDelete = NewObject.PreviousObject;


BAsic3D.c:64: error: request for member 'PreviousObject' in something not a structure or union

Why ?

I tried to change struc to these :
Quote:
struct Object3DType{
int PreviousObject, NextObject;
};

Same Result ...

Any info ?

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


Re: GCC, Dynamic structure creation method ?
Quite a regular
Quite a regular


@all :
Thank you for all these precious informations.
When I'll get something to show, I'll post a sample ;)

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


Re: GCC, Dynamic structure creation method ?
Quite a regular
Quite a regular


@LiveForIt
Thank you.

A friend just sent me an e-mail explaining linked-list too.
now I understand what I must do to handle objects dynamically.

Thank you all.

Kindest Regards,
Freddix

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


Re: GCC, Dynamic structure creation method ?
Quite a regular
Quite a regular


@xeron
Do you think that handling the list per ranges can be good ?

For example :
Default is defined with 512 entries,
If more than 512, directly re-allocate 1024 entries,
if more than 1024, directly re-allocate 1536 entries,
if more than 1536, directly re-allocate to 2048 entries,
etc ...

Good idea ?

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


Re: GCC, Dynamic structure creation method ?
Quite a regular
Quite a regular


@Gazelle
I've modified. is it correct now ?

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


@afxgroup:
Why didn't you create directly a new fresh post for your problem ?

It may have been more "clear" and you can get better visibility on your question with a dedicaced post.

Kindest Regards,
Freddix

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


Re: GCC, resize dynamically an array. Possible ?
Quite a regular
Quite a regular


@Rigo:
I already own the Developer CD :p
In fact, my need is to handle a list that can contain from approx 1 element to 65535 elements.

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


Re: GCC, resize dynamically an array. Possible ?
Quite a regular
Quite a regular


@salass00
Thank you for these clean explanations :)
Now I have all informations to continue my project (until the next question :p)

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


Re: GCC, resize dynamically an array. Possible ?
Quite a regular
Quite a regular


@salass00
Thank you :)

So, I can use this function for Array resizing then ?

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


Re: GCC, Dynamic structure creation method ?
Quite a regular
Quite a regular


@salass00
It's what I supposed .... but wasn't sure ...
Thank you.

If I'm not wrong, all this should be correct :

typedef struct{
  
BOOL Exist;
  
int Type;
  
BOOL HiddenCullingTransparencyWireFrameFogAmbientLightsFiltering;
  
float XPosYPosYPos;
  
float XRotYRotZRot;
  
float XScaleYScaleZScale;
  
float RGBRedRGBGreenRGBBlue;
 }
Object3DType;

static 
Object3DType *Allocate3DObjectvoid );
static 
void Free3DObjectObject3DType *OldObject );

Object3DType *Allocate3DObjectvoid ){
  
Object3DType *NewObject NULL;
  
NewObject IExec -> AllocVecTagssizeofObject3DType ), TAG_DONE );
  if ( !
NewObject ){
    return 
NULL;
   }
  return 
NewObject;
 }

void Free3DObjectObject3DType *OldObject ){
  if ( 
obj != NULL ){
    
IExec -> FreeVecOldObject );
   }
 }


Right ?


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


GCC, resize dynamically an array. Possible ?
Quite a regular
Quite a regular


Hi All,

I've checked my entire C book concerning arrays and I did find nothing related to resizing an array.

Is it possible to directly change the size of an array inside a program ?

(post that kind of questions will probably makes me be considered as a noob ... it's a risk ... but progress nevers happen without risks ;) )

Kindest Regards,
Freddix

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


Re: GCC, Dynamic structure creation method ?
Quite a regular
Quite a regular


@xeron
Thank you for this small function.

I imagine that if I want to delete this object from memory, I'll have to do something like this :

*FreeObjectNewObjectType ){
  if ( 
NewObjectType <> ){
    
IExec->FreeVecNewObjectType );
   }
 }


Am I wrong ?

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


GCC, Dynamic structure creation method ?
Quite a regular
Quite a regular


Hi,

In fact, I want to create dynamically objects that uses a structure.

Imagine a structure like this one :

typedef struct{
  
BOOL Exist;
  
float XPosYPosZPos;
  
float XRotYRotZRot;
  
float FOV;
  
BOOL Backdrop;
  
float RangeNearRangeFar;
  
float LeftTopRightBottom;
 }
ObjectType;


I want to have a function in my program that allocate a small memory for an object that'll use this structure and, the function must return the pointer to the freshly created object structure.

I'm not enough skilled in C to imagine how to do this.
Any one got an idea about this ?

Thank you.

Kindest Regards,
Freddix


Edited by freddix on 2009/2/25 19:21:59
All we have to decide is what to do with the time that is given to us.
Go to top


Re: new Hyperion Site
Quite a regular
Quite a regular


I've re-registered an account onto the new website: Ok.
Registered Amiga OS 4.1 for Sam440ep: Ok.
Download section : 2 updates for Amiga OS 4.1: Ok.

New Hyperion website work perfectly for me :p

@HANS : I'm now waiting for your MiniGL beta release :p

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


@tonyw: I only compare boolean to TRUE or FALSE. ;) I never compare to TRUE/FALSE for integer and others data ...

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


@LiveForIt
yes, it's what was explained before, I've understood, in the last statements, it was an error from me to not modify this in the post.

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


@ssolie
It's not wrong ... but it's not perfect ;)

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



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




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project