Jump to content

  • Log In with Google      Sign In   
  • Create Account

Joshhua5

Member Since 26 Oct 2011
Offline Last Active Apr 28 2016 03:33 AM

Topics I've Started

glDrawElements only draws the first vertex

05 October 2015 - 03:24 AM

Hello,

 

I've been trying to writer a height map loader, the data on the GPU side appear to be fine. but when I render with GL_POINTS, I only get one pixel in the center of the screen. GL_TRIANGLE_STRIP doesn't show anything.

 

Here's a folder containing pictures of the callstack, vertex data, shaders, element data and the result on screen.

https://www.dropbox.com/sh/obndxcase6hzh22/AADV92E5HEGa6Xbo7OIzYfusa?dl=0

 

The only difference is I've since removed the projection and model matrix to reduce the scope of the problem.


OSX not capturing keyboard input

05 April 2015 - 11:53 PM

Hello, I'm trying to capture keyboard input for a Window on Yosemite.

When I launch the app my mouse events are caught by the window, although any keyboard events don't trigger my NSKeyDown in sendEvent function

 

How I've implemented my input handling is that I've overloaded the NSApplication sendEvent, provided a switch case for all event types and then pass the event on [super sendEvent:event] if I don't have a condition for it.

 

Then in my main loop I check for new events here 

 

void CocoaUpdateWindow(){

    NSEvent *event;

    while((event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:nil inMode:NSDefaultRunLoopMode dequeue:YES]) != nil)

        [NSApp sendEvent:event];

}

 

I got this idea from http://stackoverflow.com/questions/6732400/cocoa-integrate-nsapplication-into-an-existing-c-mainloop

 

Thank you for any help :)

 

Also I when I do type on the window, XCode in the background is receiving the input so the events aren't even getting passed to the window in the first place.


Low Level Memory Management C++

31 January 2015 - 01:26 AM

I'm trying to create a ArrayList which initializes on demand instead of on construction. My previous implementation would initialize all objects including ones which were reserved for future push's but wastefully initialized.

 

I've got the creation working perfectly, the only issue I'm having is with the deletion, Is there a way to deconstruction a section of an array without deallocation and then deallocation of the whole array without deconstruction?


How to handle states.

30 July 2014 - 06:23 AM

I've been writing an 2D engine and the problem came to mind of how to handle states. I was wondering what people would think of this solution.

 

The base state isn't removable and the link is just a header with comments on the purpose of each function.

 

https://gist.github.com/Joshhua5/072371448382abbcee94


SDL_Audio, questions about the format of the stream

14 June 2014 - 12:06 AM

Let's say I've set my stream to be signed 16 bit numbers, with 2 channels, would this mean that the stream that I'm populating is set up so that the first 16 bits will be the left channel and then the following 16 bits will be the right and the collection of 32 bits is the sample?

[L - 16][R - 16][L - 16][R - 16]
[ Sample - 32 ][ Sample - 32 ]

 

Thank you for any help :)


PARTNERS