Search the web
Sign In
New User? Sign Up
realtime_raytracing · Discuss programming techniques, algorithms and productions related to realtime raytracing, both software or hardware based.
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Intel Compiler / Hardware Questions   Message List  
Reply | Forward Message #284 of 314 |
Re: [realtime_raytracing] Intel Compiler / Hardware Questions

"neoakata" <tranderson@...> wrote Thu, 11 Apr 2002 20:24:14 -0000 :

> Taking your advice, I'd like to write this to be as OS independent as
> possible.

> 1) I've written graphics applications for DOS4GW & Windows (and some
> other out of date operating systems) but never linux. I know that
> even doing something as simple as setting up the resolution and
> plotting a single pixel on the screen can be a difficult thing to
> figure out when you are just getting familiar with doing graphics in
> a new environment. Would anyone happen to have a silly little plot a
> pixel program that runs in linux? (or know where I can find some
> code that would help?)

Ok, using the SDL will make this soooooo intricate.
This program will compile & run under unix, windows, macos, beos and even
playstation 2, and will take advantage of most available hardware
accelerations when copying the buffer into video memory.

1st.c:
********************* CUT HERE **********************************
#include <SDL/SDL.h>

unsigned long *buffer = NULL;
unsigned int L,H;

void putpixel(unsigned int x,unsigned int y, unsigned long clr) {
buffer[x+y*L] = clr;
}

int main() {
SDL_Surface *ecran;
char quit = 0;
int i;

L = 640;
H = 480;

SDL_Init( SDL_INIT_VIDEO );
ecran = SDL_SetVideoMode( L,H,32, 0 /*SDL_FULLSCREEN*/ );
buffer = (unsigned long*)ecran->pixels;

memset(ecran->pixels,0xff,640*480*4);
for (i=0; i<200; i++)
putpixel(i,i,0xff00ff);

SDL_Flip( ecran );

while (!quit) {
SDL_Event event;
if ( SDL_PollEvent(&event) )
switch (event.type) {
case SDL_QUIT:
quit = 1;
break;
case SDL_KEYDOWN:
switch (event.key.keysym.sym) {
case SDLK_q:
case SDLK_ESCAPE:
quit = 1;
break;
}
break;
}
}

SDL_Quit();

return 0;
}
********************* CUT HERE **********************************
And you have a window, with graphism, keyboard and window-closing button being
handled.


To compile:
gcc -c -o 1st.o 1st.c
gcc -lSDL 1st.o -o 1st

> 5) In general, for cross platform graphics development, what IS the
> best OS to develop in?

The one you prefer. But for cross-platform, never use VC+: lots of standard
stuff
not supported, and lots of non standard stuff integrated.
For example in my case I stick to Linux, but only because it is my favorite
development
environment.




Fri Apr 12, 2002 8:53 pm

tfpsly
Offline Offline
Send Email Send Email

Forward
Message #284 of 314 |
Expand Messages Author Sort by Date

Thank you all for the recommendations. I've been spending some time reading through all of the old RTRT messages and in particular - Ingo Wald's excellent...
neoakata
Offline Send Email
Apr 12, 2002
1:43 pm

... i'd start with glut. use the glut-functions to open your window and for input handling, raytrace your image into a memory region, and display that as a...
Ingo Wald
wald@...
Send Email
Apr 12, 2002
7:31 pm

... Ok, using the SDL will make this soooooo intricate. This program will compile & run under unix, windows, macos, beos and even playstation 2, and will take...
Sly
tfpsly
Offline Send Email
Apr 13, 2002
9:57 am

Hi everybody, ... Yes, let me also use this opportunity to express my gratetude to the helpful people around here. Ingo: I am looking very much forward to read...
Daniel Povlsen
danielpovlsen
Offline Send Email
Apr 13, 2002
9:58 am

... standard stuff ... With little attention you can easily use vc++ and still code portable stuff... vc's ide is really good, and it have very nice features...
Marco *PaN!* Foco
pan@...
Send Email
Apr 13, 2002
2:31 pm

... though they are also all on my web site, the best place to find them (and any successive papers, which might be written by other people) is on ...
Ingo Wald
wald@...
Send Email
Apr 15, 2002
8:13 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help