Question about Microsoft Visual Studio 2005 Standard Edition for PC

1 Answer

Texture mapping problem

Hello. I want to load .bmp file in my opengl program(using C). When I tried using texture mapping functions, the output was different from what the file had. Can you help me as early as possible. Thanks in advance.

Posted by on

Ad

1 Answer

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that gotĀ 5 achievements.

    Vice President:

    An expert whose answer gotĀ voted for 100 times.

    Sniper:

    An expert who has posted more than 50 answers, of which 90% or more were rated as helpful.

  • Expert
  • 81 Answers

Here:
#include<stdio.h>
#include<conio.h>
#include <graphics.h>
#include <stdlib.h>
#include <alloc.h>
///////////////////////////////////////////////// BMP format structures
typedef struct tagBITMAPFILEHEADER {
int bfType;
long bfSize;
int bfReserved1;
int bfReserved2;
long bfOffbits;
}BITMAPFILEHEADER;
typedef struct tagBITMAPINFOHEADER {
long biSize;
long biWidth;
long biHeight;
int biPlanes;
int biBitCount;
long biCompression;
long biSizeImage;
long biXPelsPerMeter;
long biYPelPerMeter;
long biClrUsed;
long biClrImportant;
} BITMAPINFOHEADER;
typedef struct tagRGBQUAD {
char rgbRed;
char rgbGreen;
char rgbBlue;
char rgbRserved;
} RGBQUAD;
typedef struct tagBITMAPINFO {
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[256];
}BITMAPINFO;
///////////////////////////////////////////////// SVGA256 set functions
int huge p(void) { return(2); }
void setvideo()
{ int gdriver,gmode;
// gdriver=installuserdriver("svga256",p);
gdriver=DETECT;
initgraph(&gdriver,&gmode,"c:\\minc\\bgi");
}
///////////////////////////////////////////////// MAIN
void main(){
FILE *bmpfile;
BITMAPFILEHEADER bheader;
BITMAPINFO binfo;
char color, huge *buff;
long rest, width, i, j, k;
clrscr();
bmpfile=fopen("my.bmp", "rb");
// read info
fread(&bheader, sizeof(bheader), 1, bmpfile);
fread(&binfo, sizeof(binfo), 1, bmpfile);
fseek(bmpfile, bheader.bfOffbits, 0);
// picture width score
if(rest=binfo.bmiHeader.biWidth % 4)
width = binfo.bmiHeader.biWidth+ 4-rest;
else
width = binfo.bmiHeader.biWidth;
// from file to array (64K==MAX)
buff=(char far *)farmalloc(binfo.bmiHeader.biHeight*width);
k=0;
for(j=0; j<binfo.bmiHeader.biHeight; j++)
for(int i=0; i<width; i++){
fread(&color, sizeof(color), 1, bmpfile);
buff[k++]=color;
}

setvideo();
// set palette
for(i=0; i<256;i++)
setrgbpalette(i, binfo.bmiColors[i].rgbBlue>>2,
binfo.bmiColors[i].rgbGreen>>2,
binfo.bmiColors[i].rgbRed>>2
);
// drowing
k=0;
for(j=binfo.bmiHeader.biHeight; j>0; j--)
for(int i=0; i<width; i++){
putpixel(i, j, buff[k++]);
}
getch();
closegraph();

fclose(bmpfile);
}
Rate me please.

Posted on Jul 09, 2009

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Ad

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Error Code texture 6'shadowmapSamplerSun' isn't valid. Material='mc/mtl_t5_veh_sr_decal',tech='pimp_technique_lprobe_8df02d70',techType=10


This is simply a shader or a texture issue. Restart the game and if the problem persists there is a problem within the program you are using.

May 06, 2011 | Microsoft Xbox 360 Console

1 Answer

What does this error mean "Error Code texture


If you have a flashed xbox then sometime they wont load the maps or textures correct. You may need to re-flash your xbox to original firmware if you want to finish the game!

May 06, 2011 | Microsoft Xbox 360 Console

1 Answer

Hello, I am trying to find the right tool to match a stippled ceiling that had to be repairs, I have a few large areas to do. The patten looks like a flower to me. I see theres someone or here that sounds...


This is a tool that you can get at a paint store or maybe home depot or lowes. It is a texture brush that is "slapped" on the wet texture to create the pattern. It is usually a tool with two side by side brushes whose bristles are shaped in the form of an oval. Just slap the brush on the wet texture and turn it randomly to make the random patterns. I believe it is called a "crowfoot" texture brush in the trade.

Mar 29, 2011 | Garden

1 Answer

FATAL PROBLEM: -->A required texture format


DXTC is an acronym or stands for DirectX Texture COmpression.
The three algorithms are different only for the alpha channel compression, the RGB part is exactly the same for all three. So if you don't need alpha blending you should use DXT1, as using DXT3 or DXT5 will only double dds file size without any improvement in visual quality. Instead, I regularly find out in texture replacement lots of DXT5 compressed textures with the default white alpha channel.
So what i suggest is you download a directX and if you will delete a games of software dont update the directx

Aug 27, 2010 | Intel CELERON 2.66Ghz CPU AND MOTHER BOARD...

1 Answer

How do you stomp texture or stipple a ceiling?


There are a ton of different ways you can get this done. You can purchase what is called a popcorn sprayer that works like an air powered paint gun for ceilings of course you'll need a compressor also. Some hardware stores rent this equipment. You'll be spraying on a material also available at most local hardware stores that is sort of like drywall joint compound only a different consistency.

If you choose to texture by hand you can use a number of tools to get different textures paintbrushes, brooms sponges, precut stencils, rags, etc.. Basically clear out the room cover anything you don't want to get messed up gt a bucket of drywall joint compund your texture tool of choice and a trowel. spread a thin layer of compund on the ceiling and texture away. The thicker you spread it the more texture you will get. Be sure to have a helper that can switch off as this does get tiring, and you'll need extra hands to help get clean water for your tools so your texturing project is consistent. Plan accordingly, this is not a project you want to leave halfway through and finish another day. If you start a room, finish it. or you will notice the difference in texture every time you sit down and try to relax.

Feb 15, 2010 | SK 17855 Long Reach Needle Nose Compound...

1 Answer

Can anyone please tell me if my video card is a capture card? Nvidia Geforce 6200 thanks joe


Tech Specs CineFX 3.0 Shading Architecture
  • Vertex Shaders
    • Support for Microsoft DirectX 9.0 Vertex Shader 3.0
    • Displacement mapping
    • Geometry instancing
    • Infinite length vertex programs
  • Pixel Shaders
    • Support for DirectX 9.0 Pixel Shader 3.0
    • Full pixel branching support
    • Support for Multiple Render Targets (MRTs)
    • Infinite length pixel programs
  • Next-Generation Texture Engine
    • Up to 16 textures per rendering pass
    • Support for 16-bit floating point format and 32-bit floating point format
    • Support for non-power of two textures
    • Support for sRGB texture format for gamma textures
    • DirectX and S3TC texture compression
    • Full 128-bit studio-quality floating point precision through the entire rendering pipeline with native hardware support for 32bpp, 64bpp, and 128bpp rendering modes

64-Bit Texture Filtering and Blending
  • Full floating point support throughout entire pipeline
  • Floating point filtering improves the quality of images in motion
  • Floating point texturing drives new levels of clarity and image detail
  • Floating point frame buffer blending gives detail to special effects like motion blur and explosions

Intellisample 3.0 Technology
  • Advanced 16x anisotropic filtering
  • Blistering-fast antialiasing and compression performance
  • New rotated-grid antialiasing removes jagged edges for incredible edge quality
  • Support for advanced lossless compression algorithms for color, texture, and z-data at even higher resolutions and frame rates
  • Fast z-clear
  • High-resolution compression technology (HCT) increases performance at higher resolutions through advances in compression technology

UltraShadow II Technology
  • Designed to enhance the performance of shadow-intensive games, like id Software's Doom 3

TurboCache Technology
  • Shares the capacity and bandwidth of dedicated video memory and dynamically available system memory for optimal system performance.

PureVideo Technology
  • Adaptable programmable video processor
  • MPEG video encode and decode
  • High-definition MPEG-2 hardware acceleration
  • High-quality video scaling and filtering
  • DVD and HDTV-ready MPEG-2 decoding up to 1920x1080i resolutions
  • Dual integrated 400 MHz RAMDACs for display resolutions up to and including 2048 × 1536 at 85Hz
  • Display gamma correction
  • Microsoft® Video Mixing Renderer (VMR) supports multiple video windows with full video quality and features in each window

Advanced Display Functionality
  • Dual integrated 400MHz RAMDACs for display resolutions up to and including 2048x1536 at 85hz
  • Dual DVO ports for interfacing to external TMDS transmitters and external TV encoders
  • Full NVIDIA® nView™ multi-display technology capability

Advanced Engineering
  • Designed for PCI Express x16
  • Support for AGP 8X including Fast Writes and sideband addressing
  • Designed for high-speed GDDR3 memory
  • Advanced thermal management and thermal monitoring

NVIDIA® Digital Vibrance Control™ (DVC) 3.0
  • DVC color controls
  • DVC image sharpening controls

Operating Systems
  • Windows XP
  • Windows ME
  • Windows 2000
  • Windows 9X
  • Macintosh OS, including OS X
  • Linux

API Support
  • Complete DirectX support, including the latest version of Microsoft DirectX 9.0 Shader Model 3.0
  • Full OpenGL support, including OpenGL 2.0
GeForce 6 Series GPUs Features Comparison:
Feature GeForce 6800
Models
shim.gif GeForce 6600
Models
shim.gif GeForce 6200
Models
shim.gif GeForce 6200
w/Turbocache
shim.gif Microsoft® DirectX® 9.0 SM 3.0 SM 3.0 SM 3.0 SM 3.0 Graphics Bus Technology AGP 8X/PCI Express AGP 8X/PCI Express AGP 8X/PCI Express PCI Express NVIDIA® Intellisample™ Technology 3.0 3.0 3.01 3.01 NVIDIA® SLI™ Technology X2 X2 n/a n/a NVIDIA® PureVideo™ Technology X3 X3 X3 X3 NVIDIA® TurboCache™ Technology n/a n/a n/a X4 64-bit Texture Filtering and Bending X X n/a n/a Effective Memory Interface 256-bit 128-bit 128-bit 128/64-bit Memory GDDR35 and DDR GDDR35 and DDR DDR DDR Process 0.13 micron 0.11 micron 0.11 micron 0.11 micron RAMDACs 400 MHz 400 MHz 400 MHz 400 MHz
1. GeForce 6200 models do not include compression technology.
2. NVIDIA SLI: Available on SLI-certified versions of GeForce 6800 Ultra, 6800 GT, 6800 GS, 6800, 6800 XT, 6800 LE, 6600 GT, 6600, and 6600 LE PCI Express GPUs only.
3. Features may vary by product. Some features may require additional software.
4. Available on select GeForce 6200 models only.
5. GDDR3 - GeForce 6800 Ultra, 6800 GT, 6800 GS, and 6600 GT only.

Nov 20, 2009 | Nvidia GeForce 6200 AGP Graphic Card

2 Answers

MISSING TEXTURE


in the installation files somewhere are the textures that apply to some of the graphics for grass and clay etc. These have not installed or are in the wronmg place for the program to access them. Note where it says they should be when it reports the problem. get them from CDnd put them there manually

Aug 12, 2009 | ASUS KM400/VT8235CE (90-M7A78A-GOUAYZ)...

1 Answer

PS2 does not function as DVD player, Pls advise


Try changing the disc speed and texture mapping.
I had the same problem not too long ago

Dec 26, 2008 | Sony PlayStation 2 (PS2) Console

1 Answer

Texture tool


checkout for the texture name, whether it contains special characters or not, also try reinstalling the application, if none work, try getting Help from the manufacture :P

Mar 16, 2007 | Disney Magic Artist Deluxe (4470201514)

Not finding what you are looking for?
Microsoft Visual Studio 2005 Standard Edition for PC Logo

Related Topics:

88 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

micky dee

Level 3 Expert

2774 Answers

Piyal Perera
Piyal Perera

Level 3 Expert

528 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18394 Answers

Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...