Jump to content

  • Log In with Google      Sign In   
  • Create Account

telaryus

Member Since 27 Feb 2009
Offline Last Active Apr 20 2013 05:42 PM

Posts I've Made

In Topic: Odd issue when rendering

20 April 2013 - 05:36 PM

All right, got it fixed. It's been too long since I last touched graphics stuff so I forgot about the whole 0.5 pixel location thing. Which is one of the reasons that I'm doing this... experiment.

 

And yes, I realize that pushing to a texture and rendering a quad is the better solution but when I looked for how to do this, all I got was this whole binding a frame buffer to a texture and doing the draw calls to that. Ergo, it seemed pointless to go that route.

 

Thanks.


In Topic: Odd issue when rendering

20 April 2013 - 03:13 PM

Is there a reason you're drawing all those vertices? Wouldn't it be easier to create a texture and render it on a fullscreen quad?

 

From what I saw, rendering to a texture was about as equivalent to rendering to the screen. i.e. you just targeted a different framebuffer that was bound to a texture.

 

Maybe I missed something?


In Topic: Odd issue when rendering

20 April 2013 - 01:51 PM

So what is the issue?

The first image shows the issue: when I draw points on the left half of the screen it seems to decide to skip a few columns. It's an 800x600 window and I'm drawing 800x600 points.

 

Second and third images show me drawing my rasterizer to a localized region of the window (400x300 points).

 

--

In:

int x = i % m_bufferWidth;
int y = i / m_bufferWidth;
int halfWidth = m_bufferWidth / 2;
int halfHeight = m_bufferHeight / 2;


Shouldn't it be:

int y = i / m_bufferHeight;

 

No, as it is an array that I am indexing. As such, the rows are calculated as (i / width).

 

--

And why are you using prehistorical OpenGL? Or are you stuck with good-for-nothing video card (like I am)?

 

Because I was referencing openGL books I had on hand.

 

--

It's just frustrating that I tell the thing to render 800x600 points and it apparently gets lazy halfway through.


In Topic: i need help with a c program

07 March 2011 - 05:55 PM

Looks to be because your quancalc() function takes an array of numbers, but you are trying to pass it a single value.

int quancalc(int[]);
//...
printf("\n Item Quantity: \n"); quancalc(arr[i].Pnum);
The quancalc function looks wrong too. You are indexing an array of numbers but no where in your program have you created such an array.
I think maybe you meant to pass a single int value by address in which case this would be what you are looking for:
void quancalc(int*);
//...
printf("\n Item Quantity: \n", arr[i].quantity); quancalc(&arr[i].quantity);
//...
void quancalc (int *x){
  int qhand, sold;
  printf("\n Item amount sold: ");
  scanf("%d",&sold);
  (*x)-=sold;
} 
I'm not positive that this is the functionality you are looking for, but from what I can glean from your code it looks like it might be.

Also you try to read into B which doesn't exist in your program.
//...
  	printf("\n Please enter item number: ");
  	scanf("%d",&<img src='http://public.gamedev.net/public/style_emoticons/default/cool.gif' class='bbc_emoticon' alt='B)' />;  // Assuming this should be 'b'
//...

Also make sure that you initialize your variables, otherwise you'll have a lot of undefined behavior throughout your program.

In Topic: Statically Linking and Stuff

18 February 2011 - 11:27 AM

What is the actually link error you are getting?

I am able to have both <windows.h> and <Windowsx.h> with /MT[d] enabled.

PARTNERS