Search found 21 matches

by Progs
Tue Nov 02, 2004 9:44 am
Forum: General Discussion
Topic: How can i use unsigned bytes ?
Replies: 3
Views: 1002

Txs !!
:!:
by Progs
Tue Nov 02, 2004 8:33 am
Forum: General Discussion
Topic: How can i use unsigned bytes ?
Replies: 3
Views: 1002

How can i use unsigned bytes ?

It is possible ?
I need them to store OpenGL color values..
so i have vertex

Structure mae_2dvertex
;GL_T2F_C4UB_V3F
uv.f[2]
color.b[4]
pos.f[3]
EndStructure

i cant use floats in this vertex type (GL_T2F_C4UB_V3F) and i dont want to use different type.

and i have troubles with colors ...
by Progs
Sun Oct 24, 2004 7:27 pm
Forum: General Discussion
Topic: Floats as a return param in DLL
Replies: 13
Views: 2892

It is possible not to write debug function ? or it is requared thing ?
by Progs
Sun Oct 24, 2004 3:11 pm
Forum: General Discussion
Topic: Floats as a return param in DLL
Replies: 13
Views: 2892

Txs for link !
by Progs
Sun Oct 24, 2004 1:52 pm
Forum: General Discussion
Topic: Floats as a return param in DLL
Replies: 13
Views: 2892

and again... a can't make pure library...
i have C code

#include <stdio.h>
#include <windows.h>

extern char *PB_DEBUGGER_ErrorDescription;
extern HWND PB_DEBUGGER_Window;
extern int PB_DEBUGGER_Control;
extern HINSTANCE PB_Instance;
extern char *PB_StringBase;

static void SendDebuggerError(char ...
by Progs
Wed Oct 20, 2004 3:11 pm
Forum: General Discussion
Topic: Floats as a return param in DLL
Replies: 13
Views: 2892

Txs for replays.
will try to use libraries...
by Progs
Wed Oct 20, 2004 5:28 am
Forum: General Discussion
Topic: Floats as a return param in DLL
Replies: 13
Views: 2892

Rings wrote:try following:
OpenConsole()
PrintN( StrF(test_int_()))
PrintN( StrF(peekl(test_float_())))
PrintN( StrF(peekl(test_double_())))
Input()
CloseConsole()
Error... programm crashed :?
by Progs
Tue Oct 19, 2004 12:21 pm
Forum: General Discussion
Topic: Floats as a return param in DLL
Replies: 13
Views: 2892

maybe its because wrong DLL import ? help !
by Progs
Tue Oct 19, 2004 11:58 am
Forum: General Discussion
Topic: Floats as a return param in DLL
Replies: 13
Views: 2892

Acctually i need floats.. double function was added just for test.
I have a good ODE wrapper library. Many function return floats.. and in PB i have BIG troubles with them. So i wrote this test DLL... all floating point results are converted to INTs
by Progs
Tue Oct 19, 2004 11:49 am
Forum: General Discussion
Topic: Floats as a return param in DLL
Replies: 13
Views: 2892

Floats as a return param in DLL

a have a DLL

#define API extern "C" __declspec(dllexport)
#define CALL _stdcall

API double CALL test_double() {
return 0.12345;
}

API float CALL test_float() {
return 0.12345f;
}

API int CALL test_int() {
return 12345;
}


i make DLL and convert it to PB lib
now im making test PB source ...
by Progs
Fri Oct 15, 2004 1:14 pm
Forum: Feature Requests and Wishlists
Topic: [Implemented] Double floats for 3.92
Replies: 11
Views: 2844

Dunno...
Im making small 3d engine and have no problems...

here part of init function

Code: Select all

    glEnable_(#GL_DEPTH_TEST)
    glDepthFunc_(#GL_LESS) 
    glClearDepth__( 1.0 ) ;no problems here !    
    glBlendFunc_(#GL_SRC_ALPHA, #GL_ONE_MINUS_SRC_ALPHA)
And what extention whants double floats :?:
by Progs
Fri Oct 15, 2004 4:55 am
Forum: Feature Requests and Wishlists
Topic: [Implemented] Double floats for 3.92
Replies: 11
Views: 2844

Just download glWrapper and use
glClearDepth__()
a dunno why you need 64 bit for 1.0 :)
glClearDepth__( 1.0 )
by Progs
Thu Oct 14, 2004 1:14 pm
Forum: Feature Requests and Wishlists
Topic: OPTIMIZATION !
Replies: 10
Views: 2541

You can write directly in asm :D

Example... pure function

Procedure.l mae_linkedlist_next()
If *mae_selectedlinkedlist\nxt = 0
*mae_selectedlinkedlist\pointer = 0
ProcedureReturn 0
EndIf

*mae_selectedlinkedlist\pointer = *mae_selectedlinkedlist\nxt
*mae_selectedlinkedlist\nxt = *mae ...
by Progs
Thu Oct 14, 2004 9:36 am
Forum: Feature Requests and Wishlists
Topic: OPTIMIZATION !
Replies: 10
Views: 2541

OPTIMIZATION !

I wish to see better assembler output....
I suppose that now ther is no optimization at all... only Line by line translation to asm.

Here PureBasic generated code

; *mae_selectedlinkedlist\count = *mae_selectedlinkedlist\count - 1
MOV ebp,dword [p_mae_selectedlinkedlist]
MOV ebx,dword [ebp+20 ...
by Progs
Sat Oct 09, 2004 9:01 am
Forum: Tricks 'n' Tips
Topic: Small trick with ASM
Replies: 4
Views: 2234

Yes. glLightModelfv sets Ambient light level.
Function takes pointer to array of 3 floats
without asm it may looks like


structure color
r.f, g.f, b.f
end structure

procedure set_ambient( r.f,g.f,b.f )
c.color
c\r = r
c\g = g
c\b = b
glLightModelfv_( #GL_LIGHT_MODEL_AMBIENT, @c ...