C++ :: How To Write Graphics Pipeline
Nov 25, 2014
I have been learning Direct3D for a while now (DX11), and I ran into a bit of a dead end. I have Frank Luna's book on D3D programming, but I feel like I could find a better tutorial out there. I am at the point of writing the vertex shader (the first one he goes over)
Currently, I am using .fx files to write the shaders. Is that right?
View 10 Replies
ADVERTISEMENT
Feb 3, 2014
While testing some simple examples with glDrawArrays I noticed switching it to shaders can cut my frame rate by over half (from 600- 300). I know I am using a bunch of deprecated code in GLSL right now but I don't expect it to cause that much of an fps drop. I would say it was just my intel graphics chip but if the FFP can handle it I see no reason shaders can't.
--Windows 7 Premum 64-bit
--Intel Core i3 540
--Intel HD Graphics
//Sending 10,000 quads with GLfloats (So Vertices vector has 80,000 elements, currently no indexing).
//Vertices allocated earlier in code, before main game loop
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glEnableClientState(GL_VERTEX_ARRAY );
glVertexPointer(2, GL_FLOAT, 0, 0);
glDrawArrays(GL_QUADS, 0, Vertices.size() / 2);
[Code] .....
The highest Opengl version I can run is 2.1 so 120 in shaders. I know this is a fairly pointless test right now but it is still surprising to see, anything obvious I am missing?
View 19 Replies
View Related
Jul 7, 2014
So I've got a sensor (contains a gyroscope, accelerometer, and magnetometer) that outputs quaternion data. I'm looking to take that data and use it to display the rotation of my sensor in the form of some object on the screen. I've seen instances where programs use a cube, but I'm hoping to figure out a way to have a little more control over what the object I'm rendering is.
how to get started? Are there any software packages that might be able to accomplish this?
View 1 Replies
View Related
Oct 18, 2013
I use visual studio 2012. When I asked what I should use in order to put graphics into my program, I was told by the community that SFML works well. My only problem is that now I have SFML, where and how do I unpack it?
View 6 Replies
View Related
Nov 27, 2014
I'm new to c++ So I have a project to make. I need to make a cursor like an arrow that will move when inputs are given. e.g if input is given 500 spaces UP it will move up and so on. it should rotate as well like 45 degrees and so on. how to make this arrow WITHOUT USING GRAPHICS.
View 2 Replies
View Related
Jan 6, 2013
How do I use 3D graphics .obj files created with UDK in a C++ project?
View 1 Replies
View Related
Feb 26, 2013
I am new to grpahics progamming in/under Borland C. I have included the "graphics.h" header file but i am unable to take input on the screen. If I try to move my cursor to a specified position using gotoxy() function the pointer doesnt moves to the specified location and starts taking input at (1,1) coordinate.
View 1 Replies
View Related
Nov 22, 2013
Looking for the binary search program using c Graphics....
View 5 Replies
View Related
Mar 20, 2013
I am trying to produce a image using GD graphics library. I can succesfully display my image, however I cant display this image along with a printf function too?
Code:
#include <stdio.h>
#include <gd.h>
int display_picture()
{
gdImagePtr gdImage = gdImageCreate( 50, 50 );
FILE *jpgFile = NULL;
[Code] ....
The picture displays but not hello.
View 5 Replies
View Related
Apr 24, 2014
Ive been experimenting with 3d graphics by using SDL only and lines to draw 3d shapes (no OpenGL or extension libraries, just pure math),
Ive used this page mainly to guide me on perspective projection but i have no luck [URL] ....
Ive been trying to draw a cube, but instead it gives me a mirrored dual triangular pyramids
This code here rotates the object as seen from the equations in this link: [URL] ....
double aX, aY, aZ;
for ( i = 0; i < model->qLength; i++ ) {
for ( j = 0; j < 4; j++ ) {
aX = model->quadArr[i].pointArr[j].x;
aY = model->quadArr[i].pointArr[j].y;
aZ = model->quadArr[i].pointArr[j].z;
[Code] .....
generally, i project it onto a 2d plane using: [URL] .....
double dx, dy, dz, dX, dY, dZ;
int bx, by, bX, bY;
for ( i = 0; i < model->qLength; i++ ) {
for ( j = 0; j < 4; j++ ) {
[Code] .....
I understand that my code is very messy and unoptimized, but im just concentrating on getting the core concepts to work with my code
View 1 Replies
View Related
Aug 26, 2013
I'm trying to create a GUI with Open graphics Libraries.I have made a basic GUI that exits the program or shows the instructions if a option/Polygon is marked (A bigger one is behind them)But what I'm trying to do now is the following:
0. Start the direct access on the desktop
1. Screen: Press any key to continue
2. Select one option
2.1 Option one: Go to the circuit selection menu
2.1 Option two: View the instructions (Cleared)
2.1 Option three: Exit the game (Cleared)
3. Select a circuit
4. Go to the car selection menu
5. Select a car and start the race
6. Pause menu if Spacebar has been pressed
From the pause menu:
6.1. Go to the main menu
6.2. Restart the race
6.3. Exit
I know that it is OpenGL, but what i'm looking for is C++.How I could do that? What I have cleared is with IF but I'm looking for better alternatives.
View 1 Replies
View Related
May 27, 2014
Lets say that I try and make a BASIC game with c++, how do I make the animations/graphics for the game (i.e the characters ) Do I need a specific complier/ide (I am using visual studio)
View 11 Replies
View Related
Jan 20, 2013
I'm trying to find the errors in my emulation of VGA VRAM concerning graphics modes.
(I'm testing it by doing plotting of all colors from x=0 to x=xsize-1 (where the color is relative, so 0=0 and xsize-1=maxcolor (in the case of 16 colors it's 15, etc.)))
VRAM Graphics management:
#include "headers/types.h" //Basic type support!
#include "headers/hardware/ports.h" //Basic PORT compatibility!
#include "headers/hardware/vga.h" //VGA data!
#include "headers/mmu/mmu.h" //For CPU passtrough!
#include "headers/hardware/vga_screen/vga_displaygeneration_crtcontroller.h" //For virtual width in bytes within VRAM!
[Code] .....
View 1 Replies
View Related
Dec 14, 2014
I have a college project which is a car racing game using C++ and the old-school graphics library BGI. After I draw the map and placed the objects(Car,obstacles,road's borders etc..)I added Sleep(); function to the function named Obstacles(); but the problem is, I can't move the car with the right&left arrows.a
Another problem,If I added a cleardevice(); command all objects disappears only the obstacles function keeps working. the Code is here:
char c;
do{
c = (char)getch();
if (c == KEY_LEFT) {
x = x - 10, x1 = x1 - 10;
} if (c == KEY_RIGHT) {
x = x + 10, x1 = x1 + 10;
[code].....
note: this is not the whole code, it's only a small portion of it, not a debugging question only need a hint how to fix it.
View 3 Replies
View Related
Sep 14, 2013
I needed to know if there is any possible way to make a colorful text in graphics mode
Like each letter will have different colors using setcolor(random(20));
View 1 Replies
View Related
Aug 23, 2013
What i'm trying to do is load an image from my database create some graphics to it. probably just some lines and marks and save it back to my database. here's so far what I got.
for creating graphics:
} private void pictureBox3_MouseDown(object sender, MouseEventArgs e) {
draw = true;
} private void pictureBox3_MouseMove(object sender, MouseEventArgs e) {
if (draw) {
Graphics g = Graphics.FromImage(pictureBox3.Image);
[Code] ....
but the saving part doesnt work :( I think it only saves the image loaded to the picturebox but not the graphics created to it. how to merge it? i've tried to google it and found some sort of same cases but fails to make it work, something like converting it to bitmap.
View 2 Replies
View Related
Aug 5, 2013
Here is my code:
#include <graphics.h>
#include <stdio.h>
#include <conio.h>
int main() {
int gdriver = DETECT, gmode, errorcode,i;
initgraph(&gdriver, &gmode, "c:cgi");
errorcode = graphresult();
[Code] ....
View 1 Replies
View Related
Nov 25, 2014
In this project I need to develop few functions to work with graphics card. I work in minix and this is pretty rubbish.
I'm having an hard time to read a pixel map, or atleast to print it on my main function.
I have a read_xpm function, which is given, therefore, working.
Code:
char *read_xpm(char *map[], int *wd, int *ht)
Then I have a pixmap.h file which gives some examples of pixmap images that I can use as example:
Code:
static char *pic1[] = {
"32 13 4",
". 0",
"x 2",
"o 14",
"+ 4",
[Code] ....
The doubt is. I have a test_xpm function and I need to call this char array but this is so many pointers that I can't even figure out where I'm pointed to (?)
Code: int test_xpm(unsigned short xi, unsigned short yi, char *xpm[])
I tried something like read_xpm(xi, yi, *xpm[0]); but I'm guessing I need to index that array and run all those chars in order to show them.
View 11 Replies
View Related
Aug 25, 2014
What is the limit of a VGA with 256k VRAM, running 1bpp monochrome graphics? How high can the display resolution go?
View 3 Replies
View Related
Jun 10, 2013
How would you create a video game in c++? I'm not sure really how to display the graphics and set properties and do all that stuff. I don't have money to buy a book about so how do you?
View 2 Replies
View Related
Mar 19, 2014
I am trying to compile a program with the graphics.h library included but I always get this error:Id returned 1 exit status.
View 1 Replies
View Related
Feb 6, 2015
How do you calculate the inverse view matrix?
Is that really just the inverse of the view/camera matrix?
Or is that something else?
I have seen articles online on the overall mathematical theory behind it but I am using the GLM math library and it has this nifty glm::inverse() function.
I was just curious if I can do a glm::inverse(ViewMatrix) and that would be correct.
View 2 Replies
View Related
Oct 11, 2013
I am trying to make a racing game in c/c++ using graphics. My problem as of now is that i cant get color in the enemy car when i add color it flickers
How do i remove the flickering
Here is the game which i have made till now.
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<process.h>
#include<stdlib.h>
void enemycar(int x, int y) {
setcolor(15);
[Code] ....
View 4 Replies
View Related
Aug 21, 2012
How to open a image in paint mode after that how to apply graphics to that opened image in paint mode.I am attached a image i want to draw a center line in that image..
Attached Images point1.jpg (12.9 KB)
View 1 Replies
View Related
Jul 25, 2013
I know I need <math.h> and I know how to write tan(10) or whatever I need. However I need angles, like 100 / tan10 = 567.13. The 10 is degrees.
I am doing a fun project now that I feel more confident. However my textbook only shows me how to use the math library and only shows a few trig functions.
I am applying Trigonometric Functions to see if a car is speeding.
View 3 Replies
View Related
Aug 27, 2013
For instance Code: int counter;
counter =0;
FILE *pfile;
pfile= fopen("g:myprog.txt" "w");
while (counter >100)
{ fprintf (case counter{something})}; how do I do this?
View 11 Replies
View Related