Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - hardyx

#466
Thanks Gernot!!
I'm waiting for the next update.
:booze:
#467
Quote from: Kitty Hello on 2010-Oct-28
why aren't you using short and char instead of the typedef?
Because I notice that if you use C types the array isn't created in DIM instruction using DGArray<T>, it is created instead as short& and isn't compatible with the (already defined) DGArray functions. I think you manage this types in a different way. Change the example code using short and char and you'll see.

Quote from: MrTAToad on 2010-Oct-28
Did you expand operators for use with the new types ?
Not yet, sorry. The operators are in the glb.h file.
#468
I have been writing same code to add new types to GLBasic using inline code, and here are the results. Maybe some functions aren't implemented for this types, but it's a beginning.

I defined two new integer types:
DGShort: uses 16 bits, range -32768..32767
DGByte: uses 8 bits, range 0..255

Add this to the end of the file glb.h file. This is part of GLBasic installation, and is located in "compiler\platform\include\glb.h" in the GLBasic folder. I don't like to change this file, but is the only way I know to define new base types. Using inline in the program doesn't work. If anybody knows other method, please say to me.

Code (glbasic) Select
// add this lines before the last #endif

// hardyx: new integer types
typedef short DGShort;
typedef DGArray<DGShort> DGShortArray;

typedef unsigned char DGByte;
typedef DGArray<DGByte> DGByteArray;


Now you can use arrays with bytes like this, and save many memory space:

Code (glbasic) Select
LOCAL tilemap[] AS DGByte
DIM tilemap[500][500]


Here is a GLB program to test the new types:
Code (glbasic) Select
// --------------------------------- //
// Project: Testshort v2
//

ALLOWESCAPE TRUE
SETSCREEN 320, 240, 0
LIMITFPS 30
GOSUB TestShort
GOSUB TestByte
SHOWSCREEN
KEYWAIT
END

SUB TestShort:
// this way works ok
LOCAL map[] AS DGShort
DIM map[100]

map[0] = -32000
map[1] = 1234
map[2] = 32767

PRINT "Test short array", 0,0
PRINT "map(0) = " + map[0], 0,10
PRINT "map(1) = " + map[1], 0,20
PRINT "map(2) = " + map[2], 0,30
ENDSUB

SUB TestByte:
// this way works ok
LOCAL mapb[] AS DGByte
DIM mapb[100]

mapb[0] = 0
mapb[1] = 123
mapb[2] = 255

PRINT "Test byte array", 0,50
PRINT "mapb(0) = " + mapb[0], 0,60
PRINT "mapb(1) = " + mapb[1], 0,70
PRINT "mapb(2) = " + mapb[2], 0,80
ENDSUB


I hope you like it!  :)
#469
By default the GLBasic installer installs all the platform compilers and tools. For example I don't want to develop for MacOSX, Pandora, or XBOX. Other users can develop for other platforms, and have platforms never used.

I like to see a list of platforms in the installer that you can check if you want or not. You can activate all by default, like now. This way you can save disk space and can be useful for users with netbooks for example.

This isn't very important, but it's an improvement.
#470
Caanoo and Wiz apps are not compatible, they have a different Linux kernel and binary interface. Things must to recompile with the new SDK. The analog pad and button codes are different too. But there is some source code posted in GP32X to manage this.
#471
Thank you Gernot, is a great improvement!!
#472
Quote from: XaMMaX on 2010-Oct-12
So you suggest to use c++ opengl commands in glbasic or without it in some c++ compiler?
You can use 3D in GLB, but in Wiz is slow and the shading is limited.

Quote from: Ocean on 2010-Oct-12
Nope, that cannot be it, or at least it cannot be the entire story, as WinCE doesn't sport OpenGL at all....
Windows CE, iPhone and Wiz supports Opengl-ES, a reduced version. I understand that is a lot of work to support many platforms, each with its own characteristics.
#473
The reason is that GLBasic 3d on Wiz works by software and the engine has many limitations. I think Gernot done this to reutilize the GP2X and WinCE code, and because was difficult to manage the GPH Opengl-es libraries.

Making 3D in Wiz using C/C++ and Opengl-es works very good, and has many effects. The 3D is similar to medium and high smartphones. Watch this video:


#474
I think this sentence is the equivalent in GLBasic:

PRINT "score: " + REPLACE$( FORMAT$(7, 0, Score), " ", "0"), 0, 0
#475
GLBasic - en / Re: REQUIRE
2010-Sep-27
You call another class in the constructor of a class. There is no problem if you create the other class with his constructor. Constructors are for initializing variables, don't make a big process there. If the other class must to be initialized by other methods, you must to check it with a boolean variable or a pointer to avoid errors.

Code (glbasic) Select
MyClass::MyClass()
{
   AnotherClass a(); // calls AnotherClass constructor
   a.SomeMethod();
}


or using a global class instance:

Code (glbasic) Select
static AnotherClass *a = NULL;

MyClass::MyClass()
{
   if (a == NULL)
       a = new AnotherClass(); // construct a
   a->SomeMethod();
}

#476
I think you are using two types defining the array. The type # (double) and the type casillas. Maybe the compiler not knows the type to apply in this case. If you want the fields of casillas be double, put # in this, but not in the DIM.
#477
Quote from: S. P. Gardebiter on 2010-Sep-22
Is there an unsigned char? o;

Code (glbasic) Select
LOCAL number AS BYTE
number = 255

#478
Quote from: Ian Price on 2010-Sep-16
I don't consider the Mac, iDevice etc. a tax. The license, maybe. Not the hardware itself.
And sometimes you just have to speculate to accumulate.
If you own a Mac previously and you are happy with it, you don't consider its price.
But I think is sad to have to buy a Mac *only* to make iPhone applications. If you pay a developer license to Apple, they would let you to choose your working tools.

#479
Quote from: Cliff3D on 2010-Sep-16
...and if you supply the app compiled for a platform you don't own, and it doesn't work, what do you do then?
The fact is that the platform is iPhone, not Mac. You can develop in a PC with crosscompilers and test the application in the iPhone without problems. But Apple force you to buy a Mac if you want to distribute your game in the Appstore. They want developers pay a tax of 1000+ euros for developing for iPhone. If you are an indy developer, and you want to offer a game or utility for free, or for a few cents, you can't afford this.
#480
¿This means that we can make iPhone commercial applications in a computer with Windows or Linux? ¿Or the restrictions relaxed affect only to the software, and you must to use a Mac?