Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
153 user(s) are online (105 user(s) are browsing Forums)

Members: 0
Guests: 153

more...

Headlines

Forum Index


Board index » All Posts (billyfish)




Re: Beta testing
Just popping in
Just popping in


Quote:

alfkil wrote:
I am looking for beta testers for the new Qt4.7 version (including webkit support) and a bunch of other software. Who's in? :)


If you're still after beta testers, count me in!

cheers

billy

Go to top


Re: Lockup starting qt apps
Just popping in
Just popping in


Thanks Chris, that fixed it. I'll ask Alfkil about the latest Qt beta too.

Billy

Go to top


Lockup starting qt apps
Just popping in
Just popping in


Hi all

I've recently got my hands on a shiny new X1000 (v. nice btw!) and have been looking to port an app that I wrote that uses Qt. I've installed both the user and dev packages but can't get any of the apps to run, my machine locks up and i have to reboot. I set the stack to 2000000 and tried running e.g. analogclock from a shell and it complains that I haven't got iconv library version 1 installed. I downloaded and installed the sobj from http://os4depot.net/share/development/library/libiconv_so.lha but it still complains. I assume I'm doing something dumb or have forgot something obvious.

Help!

cheers

billy

Go to top


Re: The Revenge of the Qt Demo Browser
Just popping in
Just popping in


afxgroup wrote:

Quote:
.. at this point a good profiler would help..


I'd agree but I've also found the technique listed at What can I use to profile C++ code in Linux? works really well often enough, I was sceptical till I tried it and it really works as quick solution.

Go to top


Re: Draw an arc with graphics.library
Just popping in
Just popping in


Quote:

Chris wrote:

Quote:
billyfish wrote:
The algorithm I used is based upon Bresenham's


I think that was what I looked at originally. The examples always draw a whole circle, and how to get it to only plot an arc is a bit vague. It's likely miles faster than using trigonometry for each point though, so it'll be good to get that working.


It works for arc sections too, take a look at the "Drawing incomplete octants" on the midpoint circle algorithm page.

If you can get a copy of Computer Graphics by Foley et al. it really is a goldmine of useful stuff (http://www.amazon.co.uk/Computer-Grap ... TF8&qid=1351020762&sr=1-3)

cheers

billy

Go to top


Re: Draw an arc with graphics.library
Just popping in
Just popping in


Hi Chris

The algorithm I used is based upon Bresenham's (http://en.wikipedia.org/wiki/Bresenham's_line_algorithm) and is at http://en.wikipedia.org/wiki/Midpoint_circle_algorithm. If you're looking for a smooth transition between 2 points then quaternions work well as they allow you to smoothly interpolate motion in a way that matrices can't

cheers

billy

Go to top


Re: How to initialize a struct in a class?
Just popping in
Just popping in


I'm not sure if its what you're after but what I was suggesting was that the struct that you need in your c code is in a c++ file, but wrapped in a method that is declared as extern "c" i.e

--- foo.hpp ---

extern "C"
{
struct Foo *GetTheCPlusPlusStructure ();
}

--- foo.cpp ---

struct Foo *GetTheCPlusPlusStructure () can use any c++ code e.g. for construction, member initialisation, etc.

so foo.cpp is comppiled as c++ code.

The rest of your c code can be compiled as normal as c code and just include foo.hpp and link to foo.o.

Does that make sense and/or help?

Go to top


Re: How to initialize a struct in a class?
Just popping in
Just popping in


Hi

If you're calling it from c code, you can have a stub routine written in C++ that has extern "C" around its declaration. The rest of your c code can then call this stub routine and all will happily co-exist.

Go to top


Re: Monitor randomly shutting off (compositing)??
Just popping in
Just popping in


Hi

Quote:

broadblues wrote:
No DebugPrintf doesn't use RawDoFmt else it would output '%f' unmodified and it clearly makes some attempt to process the float, but does it incorrectly



Are you sure? Wouldn't the format string need to be "%%f" to print out "%f" since you'd need to escape the % as it's a reserved char.

cheers

billy

Go to top


Re: Monitor randomly shutting off (compositing)??
Just popping in
Just popping in


alfkil wrote:

Quote:

Other problem: How to make IExec->DebugPrintF() output floats?? I try

float somefloat = 512.512;
IExec->DebugPrintF("f = %f\n", somefloat);

...but all I get is some wrong value or "infl" (or smth)... (I have also tried "%fl", it doesn't help).


I've had this problem on OS3, my suggestion is to create a wrapper function something like:
int DebugPrintDouble (const char * const str_p, const double d)
{
  
/* Get the length of the string, the size of the number before the decimal point, plus 10 for the decimal point, the fraction, the terminating NULL and the space. */
  
size_t buffer_size strlen (str_p) + ceil (log10 (d)) + 10;
  
int result 0;

  
char *buffer_p IExec -> AllocVec (buffer_sizeMEMF_ANY); 

  if (
buffer_p)
    {
       
sprintf (buffer_p"%s %.6lf"str_pd);
       
result =  IExec -> DebugPrinttF (buffer_p);
       
IExec -> FreeVec (buffer_p);
    }

  return 
result;
}


cheers

billy

Go to top


Re: Help with GUI programming
Just popping in
Just popping in


@Hans
Quote:

Why not ask for help on os4coding.net? It is, after all, a website set up specifically for AmigaOS 4.x development.


Although I aim to make an OS 4 native version once I've got an X1000, it's currently an OS 3 app.

cheers

Billy

Go to top


Re: Help with GUI programming
Just popping in
Just popping in


@chris
Quote:

Why are you using a hook for drag'n'drop? Just register the window as an AppWindow (window.class can even do this for you IIRC) and get events via the usual method. Definitely no problems with rendering this way. I didn't even know it was possible to create a hook for drop events...


I probably explained it badly, I followed trixie's example from os4coding (http://www.os4coding.net/blog/trixie/ ... ppwindows-and-appmessages). I set WINDOW_AppMsgHook to a struct Hook pointer that had its h_Entry set to my function. Is there a better way of doing it?

@broadblues

Thanks for the code, that's really useful.

Thanks to both of you with the heads up about the space.gadget as well, I'll give it a look.

Go to top


Re: Help with GUI programming
Just popping in
Just popping in


Essentially I'm drawing a 3d diagram into the Window's RastPort and then the user can rotate, scale or translate the display. The code I had in mind was John Kennedy's from his Amiga Format tutorial where he has two bitmaps and flips between them

if (which_screen)
{
myscreen->RastPort.BitMap=bitmapA;
myscreen->ViewPort.RasInfo->BitMap=bitmapA;
}
else
{
myscreen->RastPort.BitMap=bitmapB;
myscreen->ViewPort.RasInfo->BitMap=bitmapB;
}

rastport=&myscreen->RastPort;
which_screen = !which_screen;

Would using similar code to above but replacing the Screen's RastPort with the Window's RPort instead?

Go to top


Help with GUI programming
Just popping in
Just popping in


Hi all

I've got a few programming questions. I'm currently building a visualization app in C on OS 3.9 (and OS 4 once I get an X1000).

1. I've seen how you can double-buffer the screen's display using two bitmaps, can the same approach be used to double-buffer a window's display? If so, do the bitmaps need to be the size of the screen,

2. I'm currently using Reaction for the GUI and have installed a hook so that you can drag and drop files onto the window. These are then processed and loaded. I noticed that for MUI with a similar approach using hooks that you can't draw from this process, instead you use the MUIM_Draw method. Does Reaction have a similar restriction.

3. Since I'm using calls such as AreaEllipse () and Flood (), I'm setting up the TmpRas buffer. Will this work on both native and rtg displays or would it be better to have a completely separate set of routines that use Picasso96?

cheers

billy

Go to top


Re: need some english speaking person, with programming knowlege and few hours of time
Just popping in
Just popping in


Hi Kasle

I'm happy to help out with this. I've been programming in C for ages and have done a few OS3 apps (sadly no OS4 box at the moment, can't wait for the second batch of the X1000 ).

cheers

billy

Go to top


Re: gcc gnu C library Reference Manual
Just popping in
Just popping in


@tboeckel

Well spotted. Changing from a "char *" to a "char []" should fix it. Something like:


char str [] = "THIS=that@";
const char *delimiters = "=@";
char *ptr;
printf ("delimiters = %s\n", delimiters);

ptr = strtok (str, delimiters);
while (ptr)
{
printf ("strtok returned %s\n", ptr);

ptr = strtok (NULL, delimiters);
}

fflush (stdout);

Go to top


Re: gcc gnu C library Reference Manual
Just popping in
Just popping in


The restrict keyword is to do with the location that the pointer points at. Basically restrict tells the compiler that no other pointer is going to point at that memory block, so the complier can do more optimizations. See Wikipedia - restrict keyword. As for the problem you're having what happens if you do explicit checks for NULL returns from strtok?

Go to top



TopTop
« 1 ... 6 7 8 (9)




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project