Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
I. M. Gei
Jun 26, 2005

CHIEFS

BITCH



xgalaxy posted:

Do yourself a favor and drop the class now, if you can, and pickup some other class instead.
If the teacher isn't interested in loving teaching, then the only thing you will learn will be from that book, on your own, anyway.
Drop the class, keep the book.

Unfortunately, I can't just drop the class so easily. I just got admitted into upper division this semester, and this class is the only one in my major that I'm allowed to take right now - as in, all the other upper div courses require this course as a prerequisite.

The only reason this particular instructor is teaching the class at all is because the guy who was supposed to teach it had to back out after being diagnosed with brain cancer (I am not making this up), and this dude was the only person the school could find to teach it at the last minute.

Adbot
ADBOT LOVES YOU

RationalTangle
Jan 6, 2012
I'm trying to get a grasp on windows in the ncurses library for C, but I'm having trouble getting the wprintw() function to work correctly. The program compiles just fine, but I can't actually see any of the content I wanted printed into the window I create. Could somebody let me know where I went wrong, please?

code:
#include<ncurses.h>

int main()
{

WINDOW *my_win;

initscr();
my_win = newwin(0,0,0,0);
wprintw(my_win, "INSIDE");
wrefresh(my_win);
getch();

mvprintw(4,0,"OUTSIDE");
refresh();
getch();

endwin();

return 0;
}

chglcu
May 17, 2007

I'm so bored with the USA.

RationalTangle posted:

I'm trying to get a grasp on windows in the ncurses library for C, but I'm having trouble getting the wprintw() function to work correctly. The program compiles just fine, but I can't actually see any of the content I wanted printed into the window I create. Could somebody let me know where I went wrong, please?

code:
#include<ncurses.h>

int main()
{

WINDOW *my_win;

initscr();
my_win = newwin(0,0,0,0);
wprintw(my_win, "INSIDE");
wrefresh(my_win);
getch();

mvprintw(4,0,"OUTSIDE");
refresh();
getch();

endwin();

return 0;
}

I think you have to call wrefresh(my_win); IIRC, refresh only updates the default window.

Edit: nevermind, you're actually doing that.

The Gripper
Sep 14, 2004
i am winner
I think it should just be my_win = initscr() without the newwin(0,0,0,0) call. edit; that only really applies for the exact case of the code you pasted though.

ncurses is probably the shittiest library I've ever dealt with and the solution to almost every problem is to intersperse refresh(); all through your code until it works. To make your code work the way you want with any sized newwin() you can just add a refresh() call after newwin().

I have absolutely no idea why it's needed in one case but not in others, and it's probably not consistent across platforms (I know that on cygwin refresh() is needed more often, for example).

The Gripper fucked around with this message at 21:47 on Jan 28, 2013

RationalTangle
Jan 6, 2012
That works great. Thanks!

WHERE MY HAT IS AT
Jan 7, 2011
I'm having a weird problem with a function call somehow losing all but the first value of my array. In debug I can see that the array has the right values in it right before the function call, but when it gets to the other side, only the first value remains, and the array appears to be of size 1?
The relevant code looks like this:

code:
void assessGrades(int grades[5]){
	double average = 0;
	int i = 0;
	int error = 0;

	for (i = 0;i < 5;i++){
		average =+ grades[i];

		if (grades[i] < 0 || grades[i] > 100){ //range check the values every iteration and set error flag if a problem is encountered
		printf("Grade or grades entered are out of range, please try again\n");
		error = 1;
		break;
		}		
	}

	if (error == 0){ //Display output if no errors
	average /= 5;

	assessGrades(average);
	}
}
and the function is being called with assessgrades(grades), where grades is an array of ints of size 5. Any help would be muchly appreciated.

When it's called, the values are correct (for example the values will be 10 20 30 40 50 or 10 20 30 0 0 or whatever), but when I look at it or try to use it in the assessgrades() function, it's a single element array and the only value will be 10.

Jewel
May 2, 2009

WHERE MY HAT IS AT posted:

I'm having a weird problem with a function call somehow losing all but the first value of my array. In debug I can see that the array has the right values in it right before the function call, but when it gets to the other side, only the first value remains, and the array appears to be of size 1?
The relevant code looks like this:

code:
void assessGrades(int grades[5]){
	double average = 0;
	int i = 0;
	int error = 0;

	for (i = 0;i < 5;i++){
		average =+ grades[i];

		if (grades[i] < 0 || grades[i] > 100){ //range check the values every iteration and set error flag if a problem is encountered
		printf("Grade or grades entered are out of range, please try again\n");
		error = 1;
		break;
		}		
	}

	if (error == 0){ //Display output if no errors
	average /= 5;

	assessGrades(average);
	}
}
and the function is being called with assessgrades(grades), where grades is an array of ints of size 5. Any help would be muchly appreciated.

When it's called, the values are correct (for example the values will be 10 20 30 40 50 or 10 20 30 0 0 or whatever), but when I look at it or try to use it in the assessgrades() function, it's a single element array and the only value will be 10.

"Average =+ grades[i]" means it equals positive grades[i]. Which means you're re-setting average each loop. That should be "Average += grades[i]".

If there's no error, you're then also calling assessGrades again but with average as the parameter, which is a double, yet assessGrades takes a 5 long int array. Where you have assessGrades(average) you should be returning average, so replace that with "return average". You'd also have to replace "void assessGrades" with "double assessGrades".

To run it you'd have to output the return value, so "cout << assessGrades(grades) << endl;" should work.

WHERE MY HAT IS AT
Jan 7, 2011
Err, yeah. I've changed that part, thank you. Regardless, I'm only getting one value in my array. The second call at the bottom is working fine (it's an overloaded function). The function I posted though is being called from my input parsing function here:
code:
			for(i = 0; i < 20; i++){

				 if (inputBuffer[i] == ' ' || inputBuffer[i] == '\n'){

					grades[j] = atoi(currentIndex);
					j++;
					currentIndex = &inputBuffer[i+1];
				}
			}

			assessGrades(grades);
		
	
grades was originally declared in this function as an array of 5 integers. That part works fine though, it's getting the ints out of the string as it should and putting them in the array. But when the assessGrades function is called, only the first element is being passed.

Edit: nevermind, apparently they're there, visual studio just isn't showing them, as it's working after that change. You're brilliant, thanks!

WHERE MY HAT IS AT fucked around with this message at 15:51 on Jan 29, 2013

ZombieApostate
Mar 13, 2011
Sorry, I didn't read your post.

I'm too busy replying to what I wish you said

:allears:
I think it's because Visual Studio isn't smart enough to know how long the array is after you pass it into a function. Showing the first entry is pretty safe because a zero length array would be kind of useless, but it doesn't know how many to show after that. Since you know how long the array is, you can put in "grades,5" into the watch window and it'll show you 5 entries. Also, I don't think the "5" in your first line actually does anything (except freak me out).

Zeether
Aug 26, 2011

I'm working on a program in C that prints out a string if a number is bigger than another number by 0.1 or smaller than that same number by 0.1 and I'm not entirely sure how to go about putting that together into an if statement. I know how to put in greater than or equal to/less than or equal to but doing it by a specific number is stumping me. How would I pull this off?

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

Zeether posted:

I'm working on a program in C that prints out a string if a number is bigger than another number by 0.1 or smaller than that same number by 0.1 and I'm not entirely sure how to go about putting that together into an if statement. I know how to put in greater than or equal to/less than or equal to but doing it by a specific number is stumping me. How would I pull this off?

You could do:

if(A - 0.1 >= B || A + 0.1 <= B)

or

if(fabs(A - B) >= 0.1)

nielsm
Jun 1, 2009



Zeether posted:

I'm working on a program in C that prints out a string if a number is bigger than another number by 0.1 or smaller than that same number by 0.1 and I'm not entirely sure how to go about putting that together into an if statement. I know how to put in greater than or equal to/less than or equal to but doing it by a specific number is stumping me. How would I pull this off?

In other words, if the absolute difference of the numbers is greater than 0.1.

if (fabs(a-b) > 0.1) { /*code*/ }

Shugojin
Sep 6, 2007

THE TAIL THAT BURNS TWICE AS BRIGHT...


Alright I'm trying to make a bit of c code that would calculate gravitational potential at points on some pre-defined grid. My c is pretty rusty at this point so I'm a bit stuck on how the gently caress I store my poo poo in an array.

code:
float potential(int m1, int m2, int separation)
{
	int i, j;
	float phigeneral, phix, phiy, theta;
	float phitot[100][2];
	for (i=(-50); i<50; i++)
	{
		for (j=(-50); j<50; j++)
		{
			theta = j/i;
			phigeneral = ((m1/(separation - i)) - (m2/(separation - j)));
			phix = phigeneral * cos(atan(theta));
			phiy = phigeneral * sin(atan(theta));
		}
		phitot[i][j]=[phix][phiy];
	}
	return phitot;
}
I'm attempting to create a 2 x n (here 100) array that contains each the x and y components of the gravitational potential. I have math.h included so the trig nonsense shouldn't be a problem.

Actual problems I'm getting:
  • no matter where I declare phix and phiy, the compiler claims that they are declared but not used :confused:
  • also I'm generally loving lost on how I declare write to the array. Roughly what I want to do is for each of the n points there should be an x and y component of potential (ideally there should be 2 * separation^2 components the way I want to create the grid) so I want to create an array that holds all of those. I'm almost certain I am visualizing what c does with the array completely wrong so an explanation of that again would be pretty nice!

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Quick responses:

float phitot[100][2]; declares a 100 x 2 array. It looks like you want a 100 x 100 x 2 array. That would be float phi tot[100][100][2];.

You cannot assign multiple array elements at once like that. You need two assignments:
C++ code:
phitot[i][j][0] = phix;
phitot[i][j][1] = phiy;
However, a better alternative is probably to make a struct type for your elements:
C++ code:
struct phi_pair { float phix, phiy; };
struct phi_pair phitot[100][100];
...
phitot[i][j].phix = phix;
phitot[i][j].phiy = phiy;
Also, arrays are indexed starting at 0, and you cannot index into them at negative indexes. You will need to translate from your coordinate space to the range of valid indexes. If you want the valid indexes to be -50, -49, ..., 48, 49, you can just add 50, like so: phitot[50 + i][50 + j].phix = phix;. (If you want the valid indexes to go all the way up to 50, you can still add 50, but you will need to make the array 101x101.)

I do not know why your compiler is complaining about phix and phiy being unused.

nielsm
Jun 1, 2009



Your array with dimensions [100][2] means an array with two elements, which each is another array of 100 elements, which are floats. That means you have 100*2=200 elements total. Meanwhile, you are calculating values at 100*100=10000 different coordinate pairs. You also have two values calculated per coordinate pair, so 20000 total. That won't fit into your array at all.

For the assignment into the array, this line:
C++ code:
phitot[i][j]=[phix][phiy];
I'm guessing that's the one the compiler is complaining about, because it's invalid syntax. First, you are indexing the array in two dimensions, that's fine, but your indexes are bad. When i == -50 as in the first iteration of the outer loop, you get an phitot[-50], that's 50 elements before the beginning of the array. Arrays in C are always 0-indexed so if your logical coordinates (as it is here) have a different range you need to adjust for that.
Second, your index into the second dimension of the array has the same problem, range, but would also hit the problem that your second array dimension is declared to be of length 2. So fix those array dimensions.

Second, after the equals sign, that's invalid syntax. You want to store two values into the array. Either you need to make two stores (into two different indexes), which is what you would do if you have an array of floats as it is now, or you should make a struct to hold your value pairs.
But [a][b] has no meaning in C, except when used to index an array which you aren't doing there. It's not an expression by itself.

Lastly, your function is declared as returning a float, but in your return statement you are returning an array of floats.
If you want to return an array from a function you have two options: Either have the caller allocate the array for you, and then pass in a pointer to the allocated memory, or have the callee allocate the memory and return a pointer to that. The former allows the caller to make a static or stack allocation, while the latter requires you to make a dynamic allocation.

Also see what rjmccall wrote above.

Shugojin
Sep 6, 2007

THE TAIL THAT BURNS TWICE AS BRIGHT...


Okay cool. I somewhere knew about indexes starting at 0 and doing it anyway :doh:.

Trying out the rest, still getting hung up on that bizarre not recognizing variables I have right loving there. Trying a different compiler in a bit and seeing if that bit is just gcc being weird.

nielsm
Jun 1, 2009



Shugojin posted:

Okay cool. I somewhere knew about indexes starting at 0 and doing it anyway :doh:.

Trying out the rest, still getting hung up on that bizarre not recognizing variables I have right loving there. Trying a different compiler in a bit and seeing if that bit is just gcc being weird.

Did you fix the completely broken assignment syntax? Because I can imagine the compiler might throw up when presented with that.

Shugojin
Sep 6, 2007

THE TAIL THAT BURNS TWICE AS BRIGHT...


The compiler has figured out that I did in fact use phix and phiy now, at any rate, but I'm now all confused as to how I declare and pass the pointer :downs:

I am attempting to declare the pointer like this, which seems to be used in all the literature I've looked at.

code:
float phi[100][100][2], *phipass;
*phipass = phi[0][0][0];
I then pass it with

code:
Potential(m1,m2,separation,*phipass);
to Potential (I renamed some things to make slightly more sense since this is a physics problem)

code:
float Potential(int M1, int M2, int Separation, float *Phitot[100][100][2])
{
	int i, j;
	i = j = 0;	
	for (i=(-50); i<50; i++)
	{
		for (j=(-50); j<50; j++)
		{
			float phigeneral, phix, phiy, theta;
			theta = j/i;
			phigeneral = ((M1/(Separation - i)) - (M2/(Separation - j)));
			phix = (phigeneral * cos(atan(theta)));
			phiy = (phigeneral * sin(atan(theta)));
			*Phitot[i+50][j+50][0]=phix;
			*Phitot[i+50][j+50][1]=phiy;
		}
		return 0;
	}
}
It is currently throwing up about :

'function' : cannot convert from 'float' to 'float *(*)[100][2]

and giving me a warning about

'Potential' : different types for formal and actual parameter 4

(Also some warnings where I would possibly lose data by converting to type int, but this is more specifically an astrophysics problem so truncating things is going to be a negligible error :v: )

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

Shugojin posted:

code:
float phi[100][100][2], *phipass;
*phipass = phi[0][0][0];
If you read those asterisks and their phipasses out loud, the first line says "a pointer, phipass" and the second line says "the contents of phipass".

If you want phipass to be a pointer to phi[0][0][0], the syntax is
phipass = &phi[0][0][0];

(the ampersand can read out loud as "the address of")

Edit: Ignore most of what I wrote below, it is stupid and wrong, I was asleep at the time. But phipass is still redundant.

But you don't want phipass to be a pointer to phi[0][0][0], or a pointer to a float at all, you want it to be a pointer to a pointer to a pointer to a float, like phi, so you actually would want to declare it as float ***phipass.

And then phipass = phi;

Which means phipass is completely redundant, you could just pass phi to your function as a float***.

Edit: fip-rear end.

roomforthetuna fucked around with this message at 19:56 on Jan 31, 2013

shodanjr_gr
Nov 20, 2007
I'm involved in a project that requires targeting Android and x86 Windows. The application would need OpenGL support with shaders and multitouch functionality. Other niceties (like GUI widgets) would also be nice.

Does such a pipe-dream of a framework exist?

That Turkey Story
Mar 30, 2003

roomforthetuna posted:

But you don't want phipass to be a pointer to phi[0][0][0], or a pointer to a float at all, you want it to be a pointer to a pointer to a pointer to a float, like phi, so you actually would want to declare it as float ***phipass.

And then phipass = phi;

Which means phipass is completely redundant, you could just pass phi to your function as a float***.

Edit: fip-rear end.

That's not what arrays are in C or C++ and that will not compile. Arrays are not pointers. For convenience, the language gives an array the equivalent of an implicit conversion to a pointer to its first element (think of it like a type with an overloaded implicit conversion operator). A multidimensional array is an array of arrays, meaning that a pointer to the first element is a pointer to an array type. float phi[100][100][2] would decay to a float (*)[100][2]. It will not ever be able to be converted to a pointer to a pointer, since multidimensional arrays are a single chunk of contiguous memory, with no pointers in their representation (the pointer you get from decay is just a temporary).

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

roomforthetuna posted:

If you read those asterisks and their phipasses out loud, the first line says "a pointer, phipass" and the second line says "the contents of phipass".

If you want phipass to be a pointer to phi[0][0][0], the syntax is
phipass = &phi[0][0][0];

(the ampersand can read out loud as "the address of")

But you don't want phipass to be a pointer to phi[0][0][0], or a pointer to a float at all, you want it to be a pointer to a pointer to a pointer to a float, like phi, so you actually would want to declare it as float ***phipass.

Oh god stop, that is not how arrays in C work, please do not repeat this.

Shugojin: all you need to do is this:

C++ code:
float Potential(int M1, int M2, int Separation, float Phitot[100][100][2])
...
float phi[100][100][2];
...
Potential(m1,m2,separation,phi);
Here's how to understand what's going on.

An expression of array type always (with one major exception, below) immediately "decays" by becoming a pointer to the first element: one level of array turns into one level of pointer. So the expression phi has type float(*)[100][2]. An analogous thing happens with function parameters: if the parameter is written with an array type, it's really treated as a pointer to the element type: thus, Phitot really has type float(*)[100][2]. So the types match up and it works. Note that the outermost (first) bound of the array type is completely ignored in the type-checking here.

Okay, about that exception: if you take the address of an array, it doesn't lose that level of array-ness. So the expression &phi would have type float (*)[100][100][2]. If you wanted, you could declare Phitot as float (*Phitot)[100][100][2], and pass &phi as the argument; that would also work, and behind the scenes exactly the same thing would happen, with one very big exception: expressions like Phitot[x] would be indexing into an array of float[100][100][2]s, not an array of float[100][2]s. That's not what you want, because Phitot[3] would be way past the end of your array, so you'd end up having to write (*Phitot)[x] everywhere and it'd be a huge pain in the rear end.

While I'm at it, I should explain subscripting. Subscripting in C works via pointer arithmetic, so you can subscript basically any pointer. So when you write something like phi[x], first phi decays into a float(*)[100][2], then you add x to it (skipping past x float[100][2]s), and then you get an l-value to whatever you're now pointing at. Since that's an array, if you now subscript again (phi[x][y], it'll decay to a float(*)[2], you'll skip past y float[2]s and end up with an l-value at that. You can then subscript *again* and you'll be skipping past floats, and you'll end up with an l-value to a float, which you can read a single float out of or write a float into or whatever you please.

roomforthetuna
Mar 22, 2005

I don't need to know anything about virii! My CUSTOM PROGRAM keeps me protected! It's not like they'll try to come in through the Internet or something!

That Turkey Story posted:

That's not what arrays are in C or C++ and that will not compile. Arrays are not pointers.
Oops, sorry, that was terrible, I don't know what I was thinking. It would be like that if it was a dynamically sized array in every dimension, which I more often work with.

Boz0r
Sep 7, 2006
The Rocketship in action.
I've somehow told Visual Studio 2010 that it shouldn't launch my application when I click F5 or CTRL+F5. It creates a .exe-file, but it doesn't try to launch it and the files works fine. What have I messed up?

raminasi
Jan 25, 2005

a last drink with no ice
e: never mind I'm an idiot

raminasi fucked around with this message at 00:23 on Feb 1, 2013

The Gripper
Sep 14, 2004
i am winner

Boz0r posted:

I've somehow told Visual Studio 2010 that it shouldn't launch my application when I click F5 or CTRL+F5. It creates a .exe-file, but it doesn't try to launch it and the files works fine. What have I messed up?
Is this for all projects or just one in particular? You may have accidentally removed the start project in your solution or toggled it off, alternatively I've had the debugger gently caress up and require a reboot before it will properly launch anything in the IDE.

Posting Principle
Dec 10, 2011

by Ralp
STL-style containers from Google using B-Trees. Apparently they offer much better performance than std::map and std::set for large numbers of elements..

http://google-opensource.blogspot.ca/2013/01/c-containers-that-save-memory-and-time.html

FAT32 SHAMER
Aug 16, 2012



I'm trying to write a programme that will calculate the area and circumference of a circle based on the radius, seems easy enough right? For whatever reason, I can't get it to compile on the UNIX server for the life of me and I can't figure out why.

code:
#include <stdio.h> 
#define PI 3.14

int
main(void)

{ 
	int r; 
	float c, a; 
	printf("Enter radius of the circle:"); 
	scanf("%d", &r); 

	a = PI*r*2; 
	printf("The area of a circle with %d meters radius is %d meters squared"); 

	c = 2 * PI * r; //calculates circumference
	printf("The circumference of a circle with %d meters radius is %d meters"); 

	return(0)

} 
I keep getting these errors:
code:
Problem_2.c: In function āmainā:
Problem_2.c:17: warning: too few arguments for format
Problem_2.c:18: warning: too few arguments for format
I think this means that I buggered my printf function up some how but I'm not entirely sure how or where :saddowns:

The Gripper
Sep 14, 2004
i am winner
Well you're not giving it any value to use in the format string in place of %d, so you'd want something like:
code:
printf("The area of a circle with %d meters radius is %d meters squared", r, a); 

FAT32 SHAMER
Aug 16, 2012



The Gripper posted:

Well you're not giving it any value to use in the format string in place of %d, so you'd want something like:
code:
printf("The area of a circle with %d meters radius is %d meters squared", r, a); 

God dammit I thought that didn't look right, cheers mate.

Edit: it finally compiled after I removed the usage of %d twice in the same printf :v:

FAT32 SHAMER fucked around with this message at 09:17 on Feb 4, 2013

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Tusen Takk posted:

code:

a = PI*r*2; 
printf("The area of a circle with %d meters radius is %d meters squared"); 

Also, this is just the formula for circumference after some algebraic manipulation. (C does not have a built in power operator.)

FAT32 SHAMER
Aug 16, 2012



rjmccall posted:

Also, this is just the formula for circumference after some algebraic manipulation. (C does not have a built in power operator.)

Good catch on that :v: I thought I had used the carot not the asterisk for some reason.

FamDav
Mar 29, 2008

Tusen Takk posted:

Good catch on that :v: I thought I had used the carot not the asterisk for some reason.

Like the man said, c++ has no built in power operator. The carat (^) will compute bitwise XOR, not exponentiation.

The Gripper
Sep 14, 2004
i am winner

Tusen Takk posted:

God dammit I thought that didn't look right, cheers mate.

Edit: it finally compiled after I removed the usage of %d twice in the same printf :v:
You can use %d as many times as you like. %d (and %i) are for decimals though, so you'd want %f for floating point/doubles.

FAT32 SHAMER
Aug 16, 2012



FamDav posted:

Like the man said, c++ has no built in power operator. The carat (^) will compute bitwise XOR, not exponentiation.

Right, I replaced it with r*r.

code:
/*Calculates the area and circumference of a circle.*/

#include <stdio.h> //contains printf and scanf definitions
#define PI 3.14159 //defines PI

int main(void)

{ //begins class
	float r, c, a; //defines r, c, and a as floating decimal variables
	printf("Enter radius of the circle:\n", r); //prints the prompt for radius entry
	scanf("%f", &r); //scans for integer entry from keyboard

	a = PI*r*r; //calculates area
	printf("The area of the circle is %.2f meters squared\n", a); //displays calculated area

	c = 2*PI*r; //calculates circumference
	printf("The circumference of the circle is %.2f meters\n", c); //displays calculated circumference

	return(0);

} //ends class
I made it float to 2 decimal places too and switched it from integer to float since integer was limiting me to natural numbers only.

edit: ignore all the comments, it's part of the assignment :v:

nielsm
Jun 1, 2009



Unless you mean "class" as in school class, you don't have any classes in that program, just to be pedantic. (You have a single free standing function.) I would also suggest putting comments of that length on a separate line before the one it explains.

And while that kind of in-depth comments can be good while learning, it's not something you would use in a real program. Comments should explain why, not what.

(Yes I'm going to only talk about those comments you told us to ignore!)

Scaevolus
Apr 16, 2007

shodanjr_gr posted:

I'm involved in a project that requires targeting Android and x86 Windows. The application would need OpenGL support with shaders and multitouch functionality. Other niceties (like GUI widgets) would also be nice.

Does such a pipe-dream of a framework exist?

MoSync seems to at least be an attempt at what you're describing.

tractor fanatic
Sep 9, 2005

Pillbug
How do people do GUI Windows programming in C++ nowadays? Is there a favored framework, or is it a mix of MFC, ATL, QT, etc?

That Turkey Story
Mar 30, 2003

tractor fanatic posted:

How do people do GUI Windows programming in C++ nowadays? Is there a favored framework, or is it a mix of MFC, ATL, QT, etc?

It all still stinks. Sorry, I don't actually have a recommendation, I just felt the need to say that.

Adbot
ADBOT LOVES YOU

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Qt is probably the least bad choice.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply