C++ :: VGA Resolution Limit With 1bpp Mono Graphics Modes?
Aug 25, 2014What is the limit of a VGA with 256k VRAM, running 1bpp monochrome graphics? How high can the display resolution go?
View 3 RepliesWhat is the limit of a VGA with 256k VRAM, running 1bpp monochrome graphics? How high can the display resolution go?
View 3 RepliesI'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] .....
I am struggling with a project right now and I was wondering if there was a quick way to find multiple modes in a map. So far I have a function that returns a vector of one or many modes depending on the map. I can't seem to wrap my head around how to test it->second against other seconds to find the one that occurs most often.
vector<double> mode(vector<double>& input) {
map<double, double> tester;
vector<double> mode;
[Code] ....
I am in the process of writing a function that will blend two images using different blending modes. I have so far managed to implement overwrite (where i simply copy the source to the destination, including overwriting the alpha channel) and the Porter-Duff OVER mode (src OVER dst). It took quite a bit of searching but i finally found a reasonable algoritm:
//s = src, d = dst, f = final
//rgb = color, a = alpha
af = as + ad - asad;
rgb's = rgbsas; rgb'd = rgbdad;
rgb'f = rgb's + rgb'd(1-as); //src OVER dst
rgbf = rgb'f / af
I am looking for a similar algorithm for other Porter-Duff functions -- essentially, a replacement for line 5 above. I have read the original paper and some other literature on the subject but have not found an actual formula. I am particularly interested in the XOR mode and naively tried doing something like rgbf = rgbs ^ rgbd but that did not work at all.
I have done alot of googling for the scope resolution operator and Ive gained a bit of an understanding as to what it does i know it can distinguish between global and local variables, but I see it used to access methods/members of classes such as this example, why not just use a dot instead to access it?:
sql:: Driver *driver;
Why is the scope resolution operator being used here?
I have a global var (m) with an initial value 5.
I have a template class (A) that derives from a either a base class that has a member (_A1.m) or not (_A0), based upon it's template parameter. class (A) has a member function (fn) returns the value of (m) as it understands what (m) is.
However, this gives different results compared with a non-template class in a similar scenario. I'm expecting that if derived from _A1, that m should be taken from the base class scope and if derived from _A0, it should be taken from the global one.
Here is the code for your amusement:
int m = 5;
class _A0 {
public:
_A0(int) {
[Code] ....
This compiled using g++ 4.5.3 and 4.6.3 with the same results:
Global value of m is: 5
B0 class has no internal m member. Object resolves m internally with value 5
B1 class has internal m member. Object resolves m internally with value 3
A<_A0> class has no internal m member. Object resolves m internally with value 5
A<_A1> class has internal m member. Object resolves m internally with value 5
Just reading some code and come across a section where its setting the resolution on a screen
so like
image->sizeX=640;
image->sizeY = 480;
size = image->sizeX * image->sizeY *3;
float sizeLog = ceil(log((float)image->sizeX) / log(2.F)));
So yea, my understanding of this code is that firstly there is member access and that a resolution is being set.
And then its like 640 * 480 * 3
and then the log of 640 *480*3 ...being divided by something else and being rounded up by ceil
is this the right way to look at it?
and also what is the log(2.F) - i don't really understand that.
I'm trying to learn how to use variadic templates, and I decided a great example would be serializing a series of types into a stringstream:
Code:
// Send a fully constructed message.
virtual void send(ostringstream &msg) = 0;
// Construct a message from the arguments and send it.
// This is the usual entry point.
template <typename ...Args>
void send(Args ...args {
[Code] ....
This works fine, so far as I can tell. However, I decided to see if I could specialize the way certain types are serialized. I tried using a Google Protocol Buffer object as an example, and added this:
Code:
// Handle a protocol buffer type while constructing a message.
template <typename ...Args>
void send(ostringstream &msg,
const google::protobuf::MessageLite &protobuf, Args ...args) {
std::string msg_str = protobuf.SerializeAsString();
msg << msg_str;
send(msg,args...);
}
I would expect this overload to be preferred over the generic T overload when a protobuf object (which always inherits from MessageLite) is passed into send() anywhere in the list. However, this is not happening. I am getting an error message to the effect that << doesn't know how to deal with my concrete type, pointing at the T overload.
I have an mfc dialog of size 1280 X 1024 and when i change the resolution to 800 X 600, after adding scroll bar, it don't show the entire dialog contents, Seems like it clips the 800 X 600 portion.
I have handled VScroll and HScroll. It works fine for higher resolutions!
I have written a program to capture signal from machine and display it on screen in the form of sinosoidal wave. I have print buffer for 256 X 400 pixel strip chart. This prints fine if I set page size A4 and resolution 600 DPI. If anyone changes print parameters , there is problem. I can resize the printer buffer and interpolate the stored signal.
My problem is , how to find the printer resolution from GetDeviceCaps ? how to know the Print Type Normal / Draft etc in mFC.
I stumbled upon an unexpected difference between GCC and VisualStudio: Different overloaded functions are called in the following example:
// -------- can assume this is located in 'tool.h' file --------------
// Fwd declaration support foo( const int& ) gets called as expected by both compilers
// void foo( const int& n );
template< typename T >
void foo( const T& n ) {
[Code] ....
What happens: I expected that by calling bar(1) compiler will notice both versions of foo() and call the best match, in this case foo(const int&). That is not the case.
Note that overloaded foo(const int&) is below bar(). It seems that at that point GCC does not see overloaded version, and happily calls template version. Visual studio on the other hand has no problem finding them both.
If I introduce a forward declaration of foo( const int& ) before bar(), both compilers call that version correctly. Unfortunately, that is not a solution for my problem here.
Template version is part of a library while overloaded is part of the user code. Both would be located in different (header) files and I would not like to impose #include order to the users or to be dependant on it.
Need a free image library that can handle png xresolution and yresolution. I need it to be compatible with visual studio 6.0
View 1 Replies View RelatedSo 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?
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 RelatedI'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 RelatedI 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?
How do I use 3D graphics .obj files created with UDK in a C++ project?
View 1 Replies View RelatedI 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 RelatedIs there any way to set a "lock" on certain couts from system ("cls"). You can this with const to "lock" a variable to a certain value so I am wondering if that is true for couts from system ("cls"). This would make my program much simpler to write.
View 2 Replies View RelatedI want to set limit on cin for example
int i;
cout<<"Please enter 4 digits id: ";
cin>>i
If user enter more then 4 digits it must give an error
Looking for the binary search program using c Graphics....
View 5 Replies View RelatedI 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.
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
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.
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 RelatedWhat's actually wrong with the program....I'm trying to print the primes in limit of L1 and L2 ;L1<L2.... */
Code:
#include<stdio.h>
#include<math.h>
void main(){
int L1,L2,n=0
printf("Enter Limits by a space:
}
[code]....